#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int n;
int ask(const vector<int> &q) {
int x = query(q);
if (x == n) {
exit(0);
}
return x;
}
mt19937 rng(123123);
void solve(int n) {
::n = n;
vector<int> a(n);
iota(a.begin(), a.end(), 1);
shuffle(a.begin(), a.end(), rng);
int cur = ask(a);
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
swap(a[i], a[j]);
int tmp = ask(a);
if (tmp > cur) {
cur = tmp;
} else {
swap(a[i], a[j]);
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 12 |
2 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 6 |
3 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 18 |
5 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 22 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 12 |
2 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 6 |
3 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 18 |
5 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 22 |
7 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1100 |
8 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1300 |
9 |
Correct |
10 ms |
344 KB |
Correct! Number of queries: 1000 |
10 |
Correct |
10 ms |
344 KB |
Correct! Number of queries: 1300 |
11 |
Correct |
6 ms |
344 KB |
Correct! Number of queries: 900 |
12 |
Correct |
8 ms |
344 KB |
Correct! Number of queries: 1100 |
13 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1000 |
14 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1300 |
15 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1200 |
16 |
Correct |
10 ms |
596 KB |
Correct! Number of queries: 1300 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 12 |
2 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 6 |
3 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 18 |
5 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 16 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 22 |
7 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1100 |
8 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1300 |
9 |
Correct |
10 ms |
344 KB |
Correct! Number of queries: 1000 |
10 |
Correct |
10 ms |
344 KB |
Correct! Number of queries: 1300 |
11 |
Correct |
6 ms |
344 KB |
Correct! Number of queries: 900 |
12 |
Correct |
8 ms |
344 KB |
Correct! Number of queries: 1100 |
13 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1000 |
14 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1300 |
15 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1200 |
16 |
Correct |
10 ms |
596 KB |
Correct! Number of queries: 1300 |
17 |
Runtime error |
113 ms |
416 KB |
Execution killed with signal 13 |
18 |
Halted |
0 ms |
0 KB |
- |