#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
void solve(int N){
vector<int> v;
for (int i = 1; i <= N; i++) v.push_back(i);
do{
int val = query(v);
if (val == N) return;
else if (val == 5){
for (int i = 0; i < N; i++){
for (int j = i+1; j < N; j++){
swap(v[i],v[j]);
if (query(v) == N) return;
swap(v[i],v[j]);
}
}
}
}while(next_permutation(v.begin(),v.end()));
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
256 KB |
Correct! Number of queries: 681 |
2 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 18 |
3 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 328 |
4 |
Correct |
12 ms |
256 KB |
Correct! Number of queries: 627 |
5 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 321 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 23 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
256 KB |
Correct! Number of queries: 681 |
2 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 18 |
3 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 328 |
4 |
Correct |
12 ms |
256 KB |
Correct! Number of queries: 627 |
5 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 321 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 23 |
7 |
Execution timed out |
3032 ms |
256 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
256 KB |
Correct! Number of queries: 681 |
2 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 18 |
3 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 328 |
4 |
Correct |
12 ms |
256 KB |
Correct! Number of queries: 627 |
5 |
Correct |
8 ms |
256 KB |
Correct! Number of queries: 321 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 23 |
7 |
Execution timed out |
3032 ms |
256 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |