답안 #139467

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
139467 2019-07-31T19:52:46 Z zoooma13 도서관 (JOI18_library) C++14
0 / 100
2000 ms 504 KB
#include "bits/stdc++.h"
#include "library.h"
using namespace std;

#define MAX_N 202

void Solve(int N)
{
	vector <int> M(N);
    vector <vector<int>> adj(N);
	for(int i=0; i<N; i++){
        M[i] = 1;
		for(int j=i+1; j<N; j++){
            M[j] = 1;
            if(Query(M) == 1)
                adj[i].push_back(j),
                adj[j].push_back(i);
            M[j] = 0;
		}
		M[i] = 0;
	}

	int st;
    for(int i=0; i<N; i++)
        if(adj[i].size() == 1)
            st = i;

    vector <int> res;
    for(int i=0; i<N; i++){
        res.push_back(st+1);
        int to = adj[st].front();
        adj[to].erase(find(adj[to].begin() ,adj[to].end() ,st));
        st = to;
    }

	Answer(res);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 268 ms 452 KB # of queries: 18336
2 Correct 261 ms 324 KB # of queries: 18145
3 Correct 322 ms 324 KB # of queries: 19900
4 Correct 339 ms 376 KB # of queries: 19900
5 Correct 337 ms 248 KB # of queries: 19900
6 Correct 258 ms 324 KB # of queries: 19900
7 Correct 346 ms 380 KB # of queries: 19900
8 Correct 303 ms 376 KB # of queries: 18528
9 Correct 330 ms 328 KB # of queries: 19701
10 Correct 124 ms 376 KB # of queries: 8256
11 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 2 ms 248 KB # of queries: 1
13 Correct 2 ms 376 KB # of queries: 3
14 Correct 2 ms 376 KB # of queries: 6
15 Correct 4 ms 296 KB # of queries: 105
16 Correct 7 ms 376 KB # of queries: 351
# 결과 실행 시간 메모리 Grader output
1 Correct 268 ms 452 KB # of queries: 18336
2 Correct 261 ms 324 KB # of queries: 18145
3 Correct 322 ms 324 KB # of queries: 19900
4 Correct 339 ms 376 KB # of queries: 19900
5 Correct 337 ms 248 KB # of queries: 19900
6 Correct 258 ms 324 KB # of queries: 19900
7 Correct 346 ms 380 KB # of queries: 19900
8 Correct 303 ms 376 KB # of queries: 18528
9 Correct 330 ms 328 KB # of queries: 19701
10 Correct 124 ms 376 KB # of queries: 8256
11 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 2 ms 248 KB # of queries: 1
13 Correct 2 ms 376 KB # of queries: 3
14 Correct 2 ms 376 KB # of queries: 6
15 Correct 4 ms 296 KB # of queries: 105
16 Correct 7 ms 376 KB # of queries: 351
17 Execution timed out 3092 ms 248 KB Time limit exceeded
18 Execution timed out 3069 ms 248 KB Time limit exceeded
19 Execution timed out 3023 ms 248 KB Time limit exceeded
20 Execution timed out 3028 ms 248 KB Time limit exceeded
21 Execution timed out 3012 ms 376 KB Time limit exceeded
22 Execution timed out 3027 ms 248 KB Time limit exceeded
23 Execution timed out 3016 ms 248 KB Time limit exceeded
24 Runtime error 1156 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Execution timed out 3029 ms 248 KB Time limit exceeded
26 Execution timed out 3066 ms 340 KB Time limit exceeded
27 Runtime error 1136 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Execution timed out 3014 ms 248 KB Time limit exceeded
29 Execution timed out 3078 ms 376 KB Time limit exceeded
30 Execution timed out 3017 ms 248 KB Time limit exceeded