Submission #415043

#TimeUsernameProblemLanguageResultExecution timeMemory
415043snasibov05Jousting tournament (IOI12_tournament)C++14
0 / 100
1087 ms2176 KiB
#include <vector> using namespace std; #define pb push_back int GetBestPosition(int n, int c, int r, int *k, int *s, int *e) { int ans = 0; for (int i = 0; i < n; ++i) { int x = 0; vector<int> cur; for (int j = 0; j < i; ++j) { cur.pb(k[j]); } cur.pb(r); for (int j = i; j < n-1; ++j) { cur.pb(k[j]); } for (int j = 0; j < c; ++j) { vector<int> res; int mx = 0; for (int l = s[j]; l <= e[j]; ++l) { mx = max(mx, cur[l]); } if (mx == r) x++; for (int l = 0; l < s[j]; ++l) { res.pb(cur[l]); } res.pb(mx); for (int l = e[j]+1; l < cur.size(); ++l) { res.pb(cur[l]); } cur = res; } ans = max(ans, x); } return ans; }

Compilation message (stderr)

tournament.cpp: In function 'int GetBestPosition(int, int, int, int*, int*, int*)':
tournament.cpp:34:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |             for (int l = e[j]+1; l < cur.size(); ++l) {
      |                                  ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...