#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n) {
vector<int> x(n);
iota(x.begin(),x.end(),1);
int S = query(x);
for(int i=0;i<n;i++) for(int j=0;j<n;j++){
swap(x[i],x[j]);
int d=query(x);
if(d==n) return;
else if(d<=S) swap(x[i],x[j]);
S=max(S,d);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 15 |
2 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 9 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 29 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 21 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 15 |
2 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 9 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 29 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 21 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
7 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 2200 |
8 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2200 |
9 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
10 |
Correct |
18 ms |
344 KB |
Correct! Number of queries: 2300 |
11 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1500 |
12 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2000 |
13 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 1800 |
14 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 2000 |
15 |
Correct |
18 ms |
344 KB |
Correct! Number of queries: 2200 |
16 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2000 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 15 |
2 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 9 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 29 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 21 |
6 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
7 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 2200 |
8 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2200 |
9 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
10 |
Correct |
18 ms |
344 KB |
Correct! Number of queries: 2300 |
11 |
Correct |
11 ms |
344 KB |
Correct! Number of queries: 1500 |
12 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2000 |
13 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 1800 |
14 |
Correct |
17 ms |
344 KB |
Correct! Number of queries: 2000 |
15 |
Correct |
18 ms |
344 KB |
Correct! Number of queries: 2200 |
16 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2000 |
17 |
Runtime error |
92 ms |
412 KB |
Execution killed with signal 13 |
18 |
Halted |
0 ms |
0 KB |
- |