#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int n) {
vector<int> x(n);
iota(x.begin(),x.end(),1);
random_shuffle(x.begin(),x.end());
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);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 29 |
2 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 5 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
6 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 21 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 29 |
2 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 5 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
6 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 21 |
7 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
8 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2300 |
9 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 1900 |
10 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2200 |
11 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1400 |
12 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2400 |
13 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
14 |
Correct |
16 ms |
596 KB |
Correct! Number of queries: 2300 |
15 |
Correct |
13 ms |
344 KB |
Correct! Number of queries: 2000 |
16 |
Correct |
13 ms |
344 KB |
Correct! Number of queries: 2100 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
596 KB |
Correct! Number of queries: 29 |
2 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 5 |
3 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 31 |
4 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
5 |
Correct |
1 ms |
344 KB |
Correct! Number of queries: 43 |
6 |
Correct |
0 ms |
344 KB |
Correct! Number of queries: 21 |
7 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
8 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2300 |
9 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 1900 |
10 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2200 |
11 |
Correct |
9 ms |
344 KB |
Correct! Number of queries: 1400 |
12 |
Correct |
16 ms |
344 KB |
Correct! Number of queries: 2400 |
13 |
Correct |
14 ms |
344 KB |
Correct! Number of queries: 2000 |
14 |
Correct |
16 ms |
596 KB |
Correct! Number of queries: 2300 |
15 |
Correct |
13 ms |
344 KB |
Correct! Number of queries: 2000 |
16 |
Correct |
13 ms |
344 KB |
Correct! Number of queries: 2100 |
17 |
Runtime error |
103 ms |
408 KB |
Execution killed with signal 13 |
18 |
Halted |
0 ms |
0 KB |
- |