CF - Jury Marks

Author: Danh Ta Chi Thanh

Official Editorial

Time Complexity: O(K2logK)\mathcal{O}(K^2 \log K)

C++

Implementation

#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int K, N;
cin >> K >> N;
vector<int> a(K+1), b(N);
for (int i = 1; i <= K; ++i) {

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!