Submission #946078

#TimeUsernameProblemLanguageResultExecution timeMemory
946078thelegendary08Jousting tournament (IOI12_tournament)C++14
0 / 100
37 ms2828 KiB
#include<bits/stdc++.h> using namespace std; int GetBestPosition(int N, int C, int R, int *K, int *S, int *E){ //cout<<K[0]; vector<int>v; for(int i = 0;i<N-1;i++)v.push_back(K[i]); int ans = 0; for(int i = 0;i<N;i++){ int cur = 0; vector<int>w = v; if(i != N-1)w.insert(w.begin() + i, R); else w.insert(w.end(), R); for(int j = 0;j<C;j++){ int mx = *max_element(w.begin() + S[j], w.begin() + E[j]); if(mx == R)cur++; for(int k = S[j];k<=E[j];k++){ if(w[k] != mx)w.erase(w.begin() + k); } } ans = max(ans, cur); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...