# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100599 | figter001 | Jousting tournament (IOI12_tournament) | C++17 | 1064 ms | 2220 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 "grader.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
vector<int> r,tmp,nxt,e;
int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) {
for(int i=0;i<N-1;i++){
r.push_back(K[i]);
}
int ans = 0,at = 0;
for(int i=0;i<N ;i++){
int cur = 0;
tmp = r;
tmp.insert(tmp.begin() + i,R);
for(int j=0;j<C;j++){
nxt = e;
int l = S[j];
int r = E[j];
int mx = -1;
for(int x=0;x<tmp.size();x++){
if(x >= l && x <= r){
mx = max(mx,tmp[x]);
if(x == r){
nxt.push_back(mx);
if(mx == R)
cur++;
}
}else{
nxt.push_back(tmp[x]);
}
}
tmp = nxt;
}
if(cur > ans){
ans = cur;
at = i;
}
}
return at;
}
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... |