# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31105 | h0ngjun7 | Jousting tournament (IOI12_tournament) | C++14 | 1000 ms | 2436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int k[5010];
int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) {
int i, j, l, c, mx, idx, dap = 0, cnt = 0, hap = 0, ret = 0;
for(c=0;c<=N-1;c++){
cnt = 0;
for(i=0;i<N-1;i++){
k[i] = K[i];
}
for(i=N-1;i>=c+1;i--){
k[i] = k[i-1];
}
k[c] = R; hap = 0;
for(j=0;j<C;j++){
mx = -1;
for(l=S[j];l<=E[j];l++){
if(mx<k[l]){
mx = k[l];
idx = l;
}
}
if(mx == R) cnt++;
k[S[j]] = mx;
for(l=E[j]+1;l<=N-1-hap;l++){
k[l-E[j]+S[j]] = k[l];
}
hap = hap+(E[j]-S[j]);
}
if(dap<cnt){
dap = cnt;
ret = c;
}
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |