# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
260336 |
2020-08-10T05:58:46 Z |
임성재(#5050) |
도서관 (JOI18_library) |
C++17 |
|
2000 ms |
508 KB |
#include "library.h"
#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mp make_pair
static vector<int> g[222];
static bool chk[222];
void Solve(int N)
{
vector<int> M(N, 0);
for(int i=1; i<=N; i++) {
for(int j=1; j<i; j++) {
M[i-1] = M[j-1] = 1;
if(Query(M) == 1) g[j].eb(i), g[i].eb(j);
M[i-1] = M[j-1] = 0;
}
}
int cur;
for(int i=1; i<=N; i++) {
if(g[i].size() == 1) {
cur = i;
break;
}
}
chk[cur] = true;
vector<int> ans = {cur};
for(int i=1; i<N; i++) {
if(chk[g[cur][0]]) cur = g[cur][1];
else cur = g[cur][0];
chk[cur] = true;
ans.eb(cur);
}
//for(auto i : ans) cout << i << " ";
//cout << endl;
Answer(ans);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
263 ms |
376 KB |
# of queries: 18336 |
2 |
Correct |
285 ms |
256 KB |
# of queries: 18145 |
3 |
Correct |
339 ms |
372 KB |
# of queries: 19900 |
4 |
Correct |
283 ms |
376 KB |
# of queries: 19900 |
5 |
Correct |
307 ms |
256 KB |
# of queries: 19900 |
6 |
Correct |
356 ms |
376 KB |
# of queries: 19900 |
7 |
Correct |
377 ms |
376 KB |
# of queries: 19900 |
8 |
Correct |
268 ms |
376 KB |
# of queries: 18528 |
9 |
Correct |
316 ms |
376 KB |
# of queries: 19701 |
10 |
Correct |
127 ms |
380 KB |
# of queries: 8256 |
11 |
Incorrect |
1 ms |
256 KB |
Wrong Answer [5] |
12 |
Correct |
1 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 |
2 ms |
256 KB |
# of queries: 105 |
16 |
Correct |
4 ms |
256 KB |
# of queries: 351 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
263 ms |
376 KB |
# of queries: 18336 |
2 |
Correct |
285 ms |
256 KB |
# of queries: 18145 |
3 |
Correct |
339 ms |
372 KB |
# of queries: 19900 |
4 |
Correct |
283 ms |
376 KB |
# of queries: 19900 |
5 |
Correct |
307 ms |
256 KB |
# of queries: 19900 |
6 |
Correct |
356 ms |
376 KB |
# of queries: 19900 |
7 |
Correct |
377 ms |
376 KB |
# of queries: 19900 |
8 |
Correct |
268 ms |
376 KB |
# of queries: 18528 |
9 |
Correct |
316 ms |
376 KB |
# of queries: 19701 |
10 |
Correct |
127 ms |
380 KB |
# of queries: 8256 |
11 |
Incorrect |
1 ms |
256 KB |
Wrong Answer [5] |
12 |
Correct |
1 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 |
2 ms |
256 KB |
# of queries: 105 |
16 |
Correct |
4 ms |
256 KB |
# of queries: 351 |
17 |
Execution timed out |
3104 ms |
384 KB |
Time limit exceeded |
18 |
Execution timed out |
3049 ms |
376 KB |
Time limit exceeded |
19 |
Execution timed out |
3018 ms |
256 KB |
Time limit exceeded |
20 |
Execution timed out |
3012 ms |
376 KB |
Time limit exceeded |
21 |
Execution timed out |
3098 ms |
376 KB |
Time limit exceeded |
22 |
Execution timed out |
3075 ms |
384 KB |
Time limit exceeded |
23 |
Execution timed out |
3094 ms |
376 KB |
Time limit exceeded |
24 |
Runtime error |
1107 ms |
508 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Execution timed out |
3066 ms |
376 KB |
Time limit exceeded |
26 |
Execution timed out |
3005 ms |
256 KB |
Time limit exceeded |
27 |
Runtime error |
1030 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Execution timed out |
3077 ms |
504 KB |
Time limit exceeded |
29 |
Execution timed out |
3090 ms |
376 KB |
Time limit exceeded |
30 |
Execution timed out |
3072 ms |
380 KB |
Time limit exceeded |