Submission #139466

# Submission time Handle Problem Language Result Execution time Memory
139466 2019-07-31T19:51:23 Z zoooma13 Library (JOI18_library) C++14
0 / 100
344 ms 504 KB
#include "bits/stdc++.h"
#include "library.h"
using namespace std;

#define MAX_N 202

void Solve(int N)
{
    assert(N < MAX_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);
}
# Verdict Execution time Memory Grader output
1 Correct 294 ms 328 KB # of queries: 18336
2 Correct 304 ms 328 KB # of queries: 18145
3 Correct 314 ms 324 KB # of queries: 19900
4 Correct 297 ms 324 KB # of queries: 19900
5 Correct 335 ms 332 KB # of queries: 19900
6 Correct 344 ms 376 KB # of queries: 19900
7 Correct 316 ms 324 KB # of queries: 19900
8 Correct 329 ms 324 KB # of queries: 18528
9 Correct 296 ms 320 KB # of queries: 19701
10 Correct 116 ms 424 KB # of queries: 8256
11 Runtime error 2 ms 376 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 248 KB # of queries: 3
14 Correct 2 ms 376 KB # of queries: 6
15 Correct 3 ms 376 KB # of queries: 105
16 Correct 9 ms 248 KB # of queries: 351
# Verdict Execution time Memory Grader output
1 Correct 294 ms 328 KB # of queries: 18336
2 Correct 304 ms 328 KB # of queries: 18145
3 Correct 314 ms 324 KB # of queries: 19900
4 Correct 297 ms 324 KB # of queries: 19900
5 Correct 335 ms 332 KB # of queries: 19900
6 Correct 344 ms 376 KB # of queries: 19900
7 Correct 316 ms 324 KB # of queries: 19900
8 Correct 329 ms 324 KB # of queries: 18528
9 Correct 296 ms 320 KB # of queries: 19701
10 Correct 116 ms 424 KB # of queries: 8256
11 Runtime error 2 ms 376 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 248 KB # of queries: 3
14 Correct 2 ms 376 KB # of queries: 6
15 Correct 3 ms 376 KB # of queries: 105
16 Correct 9 ms 248 KB # of queries: 351
17 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 2 ms 464 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 2 ms 372 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)