Submission #100599

#TimeUsernameProblemLanguageResultExecution timeMemory
100599figter001Jousting tournament (IOI12_tournament)C++17
17 / 100
1064 ms2220 KiB
// #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)

tournament.cpp: In function 'int GetBestPosition(int, int, int, int*, int*, int*)':
tournament.cpp:26:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int x=0;x<tmp.size();x++){
                ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...