# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100599 | 2019-03-12T16:12:50 Z | figter001 | Jousting tournament (IOI12_tournament) | C++17 | 1000 ms | 2220 KB |
// #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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 4 ms | 256 KB | Output is correct |
3 | Correct | 163 ms | 536 KB | Output is correct |
4 | Correct | 162 ms | 376 KB | Output is correct |
5 | Correct | 19 ms | 512 KB | Output is correct |
6 | Correct | 153 ms | 476 KB | Output is correct |
7 | Correct | 170 ms | 504 KB | Output is correct |
8 | Correct | 179 ms | 504 KB | Output is correct |
9 | Correct | 4 ms | 376 KB | Output is correct |
10 | Correct | 25 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 861 ms | 504 KB | Output is correct |
2 | Execution timed out | 1064 ms | 684 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1004 ms | 2220 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |