#include "grid.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> SortDisks(int N) {
vector<int> correct;
vector<int> ans; ans.resize(N);
set<int> S;
for(int i = 0 ; i < N ; i++) S.insert(i);
for(int i = 0 ; i < N ; i++){
for(auto val1 : S) {
vector<int> tmp;
tmp.push_back(val1);
for(auto val2 : S) if(val1 != val2) tmp.push_back(val2);
for(int j = correct.size() - 1 ; j >= 0 ; j--) tmp.push_back(correct[j]);
int X = PutDisks(tmp);
//cout << X << '\n';
if(X == 2 * N - 1 - i) {
ans[val1] = N - i;
correct.push_back(val1);
S.erase(val1);
break;
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
6 ms |
384 KB |
Output is correct |
5 |
Correct |
7 ms |
384 KB |
Output is correct |
6 |
Correct |
6 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
6 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
6 ms |
384 KB |
Output is correct |
5 |
Correct |
7 ms |
384 KB |
Output is correct |
6 |
Correct |
6 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
6 ms |
384 KB |
Output is correct |
9 |
Incorrect |
11 ms |
384 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |
2 |
Incorrect |
11 ms |
384 KB |
Output isn't correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
6 ms |
384 KB |
Output is correct |
6 |
Correct |
7 ms |
384 KB |
Output is correct |
7 |
Correct |
6 ms |
384 KB |
Output is correct |
8 |
Correct |
6 ms |
384 KB |
Output is correct |
9 |
Correct |
6 ms |
384 KB |
Output is correct |
10 |
Correct |
6 ms |
256 KB |
Output is correct |