# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260329 |
2020-08-10T05:39:40 Z |
반딧불(#5056) |
Library (JOI18_library) |
C++17 |
|
545 ms |
384 KB |
#include <bits/stdc++.h>
#include "library.h"
using namespace std;
int n;
int arr[1002];
bool used[1002];
void Solve(int N){
n = N;
for(int i=0; i<n; i++){ /// findFirst
vector<int> v (n, 1);
v[i] = 0;
if(Query(v) == 1){
arr[0] = i;
used[i] = 1;
break;
}
}
for(int i=1; i<n; i++){
vector<int> v;
for(int j=0; j<n; j++) if(!used[j]) v.push_back(j);
while(v.size() > 1){
int vs = (int)v.size();
int vsh = vs / 2;
vector<int> tv (v.begin(), v.begin() + vsh);
vector<int> queryV (n, 0);
for(auto &x: tv) queryV[x] = 1;
int q1 = Query(queryV);
queryV[arr[i-1]] = 1;
int q2 = Query(queryV);
if(q2 == q1) v = tv;
else v = vector<int> (v.begin() + vsh, v.end());
}
arr[i] = v[0];
used[v[0]] = 1;
}
vector<int> ret (arr, arr+n);
for(auto &x: ret) x++;
Answer(ret);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
256 KB |
# of queries: 2375 |
2 |
Correct |
49 ms |
256 KB |
# of queries: 2409 |
3 |
Correct |
46 ms |
384 KB |
# of queries: 2648 |
4 |
Correct |
43 ms |
376 KB |
# of queries: 2595 |
5 |
Correct |
40 ms |
256 KB |
# of queries: 2508 |
6 |
Correct |
48 ms |
256 KB |
# of queries: 2551 |
7 |
Correct |
33 ms |
368 KB |
# of queries: 2544 |
8 |
Correct |
40 ms |
384 KB |
# of queries: 2420 |
9 |
Correct |
51 ms |
256 KB |
# of queries: 2546 |
10 |
Correct |
22 ms |
384 KB |
# of queries: 1474 |
11 |
Incorrect |
0 ms |
256 KB |
Wrong Answer [2] |
12 |
Correct |
0 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
1 ms |
256 KB |
# of queries: 4 |
14 |
Correct |
0 ms |
256 KB |
# of queries: 7 |
15 |
Correct |
2 ms |
256 KB |
# of queries: 77 |
16 |
Correct |
3 ms |
256 KB |
# of queries: 183 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
256 KB |
# of queries: 2375 |
2 |
Correct |
49 ms |
256 KB |
# of queries: 2409 |
3 |
Correct |
46 ms |
384 KB |
# of queries: 2648 |
4 |
Correct |
43 ms |
376 KB |
# of queries: 2595 |
5 |
Correct |
40 ms |
256 KB |
# of queries: 2508 |
6 |
Correct |
48 ms |
256 KB |
# of queries: 2551 |
7 |
Correct |
33 ms |
368 KB |
# of queries: 2544 |
8 |
Correct |
40 ms |
384 KB |
# of queries: 2420 |
9 |
Correct |
51 ms |
256 KB |
# of queries: 2546 |
10 |
Correct |
22 ms |
384 KB |
# of queries: 1474 |
11 |
Incorrect |
0 ms |
256 KB |
Wrong Answer [2] |
12 |
Correct |
0 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
1 ms |
256 KB |
# of queries: 4 |
14 |
Correct |
0 ms |
256 KB |
# of queries: 7 |
15 |
Correct |
2 ms |
256 KB |
# of queries: 77 |
16 |
Correct |
3 ms |
256 KB |
# of queries: 183 |
17 |
Correct |
538 ms |
376 KB |
# of queries: 17982 |
18 |
Correct |
545 ms |
384 KB |
# of queries: 17293 |
19 |
Correct |
477 ms |
384 KB |
# of queries: 17467 |
20 |
Correct |
411 ms |
384 KB |
# of queries: 16325 |
21 |
Correct |
415 ms |
384 KB |
# of queries: 15324 |
22 |
Correct |
450 ms |
376 KB |
# of queries: 17669 |
23 |
Correct |
465 ms |
384 KB |
# of queries: 17224 |
24 |
Correct |
193 ms |
384 KB |
# of queries: 7915 |
25 |
Correct |
528 ms |
376 KB |
# of queries: 17136 |
26 |
Correct |
413 ms |
376 KB |
# of queries: 15963 |
27 |
Correct |
204 ms |
384 KB |
# of queries: 8040 |
28 |
Correct |
466 ms |
384 KB |
# of queries: 15957 |
29 |
Correct |
520 ms |
384 KB |
# of queries: 15939 |
30 |
Correct |
450 ms |
384 KB |
# of queries: 15957 |