# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151169 | 2019-09-02T01:42:09 Z | imyujin | On the Grid (FXCUP4_grid) | C++17 | 18 ms | 380 KB |
#include "grid.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 1005; int chk[MAXN]; vector<int> SortDisks(int N) { vector<int> v, ans; ans.resize(N); for(int i = 0; i < N; i++) v.push_back(i); for(int i = 0; i < N; i++) chk[i] = -1; int X = PutDisks(v); while(!v.empty()) { vector<int> w; int t = v.back(); for(int i = v.size() - 1; i > 0; i--) v[i] = v[i - 1]; v[0] = t; int p = 0; for(int i = 0; i < N; i++) { if(chk[i] != -1) w.push_back(chk[i]); else w.push_back(v[p++]); } int Y = PutDisks(w); if(Y >= X) { t = v[0]; ans[t] = Y; for(int i = N - 1; w[i] != v[0]; i--) ans[t]--; chk[ans[t] - 1] = t; for(int i = 0; i < v.size() - 1; i++) v[i] = v[i + 1]; v.pop_back(); } else X = Y; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 248 KB | Output is correct |
7 | Correct | 2 ms | 248 KB | Output is correct |
8 | Correct | 2 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 248 KB | Output is correct |
7 | Correct | 2 ms | 248 KB | Output is correct |
8 | Correct | 2 ms | 248 KB | Output is correct |
9 | Correct | 2 ms | 248 KB | Output is correct |
10 | Correct | 3 ms | 376 KB | Output is correct |
11 | Correct | 3 ms | 248 KB | Output is correct |
12 | Correct | 3 ms | 376 KB | Output is correct |
13 | Correct | 3 ms | 248 KB | Output is correct |
14 | Correct | 3 ms | 296 KB | Output is correct |
15 | Correct | 3 ms | 248 KB | Output is correct |
16 | Correct | 3 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 248 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 248 KB | Output is correct |
7 | Correct | 2 ms | 248 KB | Output is correct |
8 | Correct | 2 ms | 248 KB | Output is correct |
9 | Correct | 2 ms | 248 KB | Output is correct |
10 | Correct | 3 ms | 376 KB | Output is correct |
11 | Correct | 3 ms | 248 KB | Output is correct |
12 | Correct | 3 ms | 376 KB | Output is correct |
13 | Correct | 3 ms | 248 KB | Output is correct |
14 | Correct | 3 ms | 296 KB | Output is correct |
15 | Correct | 3 ms | 248 KB | Output is correct |
16 | Correct | 3 ms | 248 KB | Output is correct |
17 | Correct | 4 ms | 376 KB | Output is correct |
18 | Correct | 12 ms | 248 KB | Output is correct |
19 | Correct | 15 ms | 380 KB | Output is correct |
20 | Correct | 18 ms | 376 KB | Output is correct |
21 | Correct | 11 ms | 376 KB | Output is correct |
22 | Correct | 18 ms | 248 KB | Output is correct |
23 | Correct | 18 ms | 248 KB | Output is correct |
24 | Correct | 18 ms | 376 KB | Output is correct |
25 | Correct | 18 ms | 376 KB | Output is correct |
26 | Correct | 18 ms | 248 KB | Output is correct |