#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
#define ll long long
#define fi first
#define se second
#define rep(x,s,e) for (auto x=s-(s>e);x!=e-(s>e);(s<e?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
mt19937 rng (266875);
void solve(int n){
vector<int> v;
rep(x,1,n+1){
v.push_back(x);
}
int curr=query(v);
while (curr!=n){
int i,j;
do{
i=rng()%n,j=rng()%n;
} while (i==j);
swap(v[i],v[j]);
int temp=query(v);
if (temp<curr){
swap(v[i],v[j]);
}
else{
curr=temp;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 66 |
2 |
Correct |
4 ms |
256 KB |
Correct! Number of queries: 4 |
3 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 33 |
4 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 38 |
5 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 20 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 16 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 66 |
2 |
Correct |
4 ms |
256 KB |
Correct! Number of queries: 4 |
3 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 33 |
4 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 38 |
5 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 20 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 16 |
7 |
Correct |
81 ms |
256 KB |
Correct! Number of queries: 6200 |
8 |
Correct |
62 ms |
256 KB |
Correct! Number of queries: 4400 |
9 |
Correct |
57 ms |
256 KB |
Correct! Number of queries: 3500 |
10 |
Correct |
51 ms |
256 KB |
Correct! Number of queries: 4200 |
11 |
Correct |
41 ms |
384 KB |
Correct! Number of queries: 3600 |
12 |
Correct |
62 ms |
256 KB |
Correct! Number of queries: 3900 |
13 |
Correct |
52 ms |
256 KB |
Correct! Number of queries: 3100 |
14 |
Correct |
53 ms |
256 KB |
Correct! Number of queries: 3800 |
15 |
Correct |
63 ms |
256 KB |
Correct! Number of queries: 4800 |
16 |
Correct |
80 ms |
384 KB |
Correct! Number of queries: 5100 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 66 |
2 |
Correct |
4 ms |
256 KB |
Correct! Number of queries: 4 |
3 |
Correct |
5 ms |
384 KB |
Correct! Number of queries: 33 |
4 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 38 |
5 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 20 |
6 |
Correct |
5 ms |
256 KB |
Correct! Number of queries: 16 |
7 |
Correct |
81 ms |
256 KB |
Correct! Number of queries: 6200 |
8 |
Correct |
62 ms |
256 KB |
Correct! Number of queries: 4400 |
9 |
Correct |
57 ms |
256 KB |
Correct! Number of queries: 3500 |
10 |
Correct |
51 ms |
256 KB |
Correct! Number of queries: 4200 |
11 |
Correct |
41 ms |
384 KB |
Correct! Number of queries: 3600 |
12 |
Correct |
62 ms |
256 KB |
Correct! Number of queries: 3900 |
13 |
Correct |
52 ms |
256 KB |
Correct! Number of queries: 3100 |
14 |
Correct |
53 ms |
256 KB |
Correct! Number of queries: 3800 |
15 |
Correct |
63 ms |
256 KB |
Correct! Number of queries: 4800 |
16 |
Correct |
80 ms |
384 KB |
Correct! Number of queries: 5100 |
17 |
Execution timed out |
3084 ms |
384 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |