# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260291 |
2020-08-10T04:22:19 Z |
반딧불(#5056) |
Library (JOI18_library) |
C++17 |
|
2000 ms |
632 KB |
#include <bits/stdc++.h>
#include "library.h"
using namespace std;
int n;
vector<int> link[202];
void Solve(int N){
n = N;
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
vector<int> vec(n, 0);
vec[i] = vec[j] = 1;
int tmp = Query(vec);
if(tmp == 1){
link[i].push_back(j);
link[j].push_back(i);
}
}
}
vector<int> ret;
int stP = 0, prv = -1;
for(int i=0; i<n; i++){
if((int)link[i].size() == 1){
stP = i;
break;
}
}
for(int i=0; i<n; i++){
ret.push_back(stP+1);
if(link[stP].empty()) break;
else if((int)link[stP].size() == 1){
prv = stP;
stP = link[prv][0];
}
else{
int tmp = prv;
prv = stP;
stP = link[prv][0] + link[prv][1] - tmp;
}
}
Answer(ret);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
275 ms |
372 KB |
# of queries: 18336 |
2 |
Correct |
279 ms |
376 KB |
# of queries: 18145 |
3 |
Correct |
242 ms |
376 KB |
# of queries: 19900 |
4 |
Correct |
304 ms |
376 KB |
# of queries: 19900 |
5 |
Correct |
354 ms |
372 KB |
# of queries: 19900 |
6 |
Correct |
299 ms |
376 KB |
# of queries: 19900 |
7 |
Correct |
399 ms |
376 KB |
# of queries: 19900 |
8 |
Correct |
295 ms |
500 KB |
# of queries: 18528 |
9 |
Correct |
302 ms |
504 KB |
# of queries: 19701 |
10 |
Correct |
146 ms |
372 KB |
# of queries: 8256 |
11 |
Correct |
0 ms |
256 KB |
# of queries: 0 |
12 |
Correct |
0 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
0 ms |
256 KB |
# of queries: 3 |
14 |
Correct |
1 ms |
256 KB |
# of queries: 6 |
15 |
Correct |
3 ms |
256 KB |
# of queries: 105 |
16 |
Correct |
7 ms |
256 KB |
# of queries: 351 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
275 ms |
372 KB |
# of queries: 18336 |
2 |
Correct |
279 ms |
376 KB |
# of queries: 18145 |
3 |
Correct |
242 ms |
376 KB |
# of queries: 19900 |
4 |
Correct |
304 ms |
376 KB |
# of queries: 19900 |
5 |
Correct |
354 ms |
372 KB |
# of queries: 19900 |
6 |
Correct |
299 ms |
376 KB |
# of queries: 19900 |
7 |
Correct |
399 ms |
376 KB |
# of queries: 19900 |
8 |
Correct |
295 ms |
500 KB |
# of queries: 18528 |
9 |
Correct |
302 ms |
504 KB |
# of queries: 19701 |
10 |
Correct |
146 ms |
372 KB |
# of queries: 8256 |
11 |
Correct |
0 ms |
256 KB |
# of queries: 0 |
12 |
Correct |
0 ms |
256 KB |
# of queries: 1 |
13 |
Correct |
0 ms |
256 KB |
# of queries: 3 |
14 |
Correct |
1 ms |
256 KB |
# of queries: 6 |
15 |
Correct |
3 ms |
256 KB |
# of queries: 105 |
16 |
Correct |
7 ms |
256 KB |
# of queries: 351 |
17 |
Runtime error |
15 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Runtime error |
35 ms |
632 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
35 ms |
376 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Runtime error |
46 ms |
380 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
21 |
Runtime error |
18 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
18 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
43 ms |
376 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
24 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Runtime error |
77 ms |
500 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
26 |
Runtime error |
17 ms |
536 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
27 |
Runtime error |
27 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Execution timed out |
3016 ms |
384 KB |
Time limit exceeded |
29 |
Execution timed out |
3039 ms |
384 KB |
Time limit exceeded |
30 |
Execution timed out |
3007 ms |
384 KB |
Time limit exceeded |