# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
415043 | snasibov05 | Jousting tournament (IOI12_tournament) | C++14 | 1087 ms | 2176 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 <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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |