답안 #260334

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
260334 2020-08-10T05:48:39 Z 문홍윤(#5075) 도서관 (JOI18_library) C++17
19 / 100
2000 ms 508 KB
#include "library.h"
#include <bits/stdc++.h>
#define eb emplace_back
using namespace std;

vector<int> link[210], ret;
void dfs(int num, int par){
    ret.eb(num);
    for(auto i:link[num]){
        if(i==par)continue;
        dfs(i, num);
    }
}
void Solve(int N){
	vector<int> qu(N);
	for(int i=0; i<N; i++){
        for(int j=0; j<i; j++){
            qu[i]=qu[j]=1;
            int tmp=Query(qu);
            if(tmp==1){
                link[i+1].eb(j+1);
                link[j+1].eb(i+1);
            }
            qu[i]=qu[j]=0;
        }
	}
	int rt;
	for(int i=1; i<=N; i++){
        if(link[i].size()<=1)rt=i;
	}
	dfs(rt, -1);
	Answer(ret);
}

Compilation message

library.cpp: In function 'void Solve(int)':
library.cpp:31:5: warning: 'rt' may be used uninitialized in this function [-Wmaybe-uninitialized]
  dfs(rt, -1);
  ~~~^~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 274 ms 376 KB # of queries: 18336
2 Correct 304 ms 384 KB # of queries: 18145
3 Correct 287 ms 376 KB # of queries: 19900
4 Correct 327 ms 376 KB # of queries: 19900
5 Correct 298 ms 504 KB # of queries: 19900
6 Correct 323 ms 376 KB # of queries: 19900
7 Correct 232 ms 380 KB # of queries: 19900
8 Correct 266 ms 376 KB # of queries: 18528
9 Correct 308 ms 508 KB # of queries: 19701
10 Correct 117 ms 368 KB # of queries: 8256
11 Correct 1 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 0 ms 256 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 384 KB # of queries: 351
# 결과 실행 시간 메모리 Grader output
1 Correct 274 ms 376 KB # of queries: 18336
2 Correct 304 ms 384 KB # of queries: 18145
3 Correct 287 ms 376 KB # of queries: 19900
4 Correct 327 ms 376 KB # of queries: 19900
5 Correct 298 ms 504 KB # of queries: 19900
6 Correct 323 ms 376 KB # of queries: 19900
7 Correct 232 ms 380 KB # of queries: 19900
8 Correct 266 ms 376 KB # of queries: 18528
9 Correct 308 ms 508 KB # of queries: 19701
10 Correct 117 ms 368 KB # of queries: 8256
11 Correct 1 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 0 ms 256 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 384 KB # of queries: 351
17 Execution timed out 3064 ms 376 KB Time limit exceeded
18 Execution timed out 3073 ms 376 KB Time limit exceeded
19 Execution timed out 3034 ms 380 KB Time limit exceeded
20 Execution timed out 3030 ms 376 KB Time limit exceeded
21 Execution timed out 3009 ms 376 KB Time limit exceeded
22 Execution timed out 3061 ms 504 KB Time limit exceeded
23 Execution timed out 3059 ms 376 KB Time limit exceeded
24 Incorrect 1114 ms 376 KB Wrong Answer [3]
25 Execution timed out 3050 ms 376 KB Time limit exceeded
26 Execution timed out 3052 ms 256 KB Time limit exceeded
27 Incorrect 1071 ms 256 KB Wrong Answer [3]
28 Execution timed out 3041 ms 376 KB Time limit exceeded
29 Execution timed out 3082 ms 380 KB Time limit exceeded
30 Execution timed out 3073 ms 380 KB Time limit exceeded