Submission #260289

# Submission time Handle Problem Language Result Execution time Memory
260289 2020-08-10T04:20:41 Z 반딧불(#5056) Library (JOI18_library) C++17
0 / 100
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 = -1, 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((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 353 ms 372 KB # of queries: 18336
2 Correct 265 ms 384 KB # of queries: 18145
3 Correct 322 ms 376 KB # of queries: 19900
4 Correct 330 ms 372 KB # of queries: 19900
5 Correct 308 ms 376 KB # of queries: 19900
6 Correct 283 ms 380 KB # of queries: 19900
7 Correct 406 ms 376 KB # of queries: 19900
8 Correct 349 ms 376 KB # of queries: 18528
9 Correct 296 ms 256 KB # of queries: 19701
10 Correct 162 ms 256 KB # of queries: 8256
11 Runtime error 1 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 1 ms 256 KB # of queries: 1
13 Correct 0 ms 256 KB # of queries: 3
14 Correct 1 ms 384 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 256 KB # of queries: 351
# Verdict Execution time Memory Grader output
1 Correct 353 ms 372 KB # of queries: 18336
2 Correct 265 ms 384 KB # of queries: 18145
3 Correct 322 ms 376 KB # of queries: 19900
4 Correct 330 ms 372 KB # of queries: 19900
5 Correct 308 ms 376 KB # of queries: 19900
6 Correct 283 ms 380 KB # of queries: 19900
7 Correct 406 ms 376 KB # of queries: 19900
8 Correct 349 ms 376 KB # of queries: 18528
9 Correct 296 ms 256 KB # of queries: 19701
10 Correct 162 ms 256 KB # of queries: 8256
11 Runtime error 1 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 1 ms 256 KB # of queries: 1
13 Correct 0 ms 256 KB # of queries: 3
14 Correct 1 ms 384 KB # of queries: 6
15 Correct 2 ms 256 KB # of queries: 105
16 Correct 5 ms 256 KB # of queries: 351
17 Runtime error 14 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 38 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 41 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 38 ms 380 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 11 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 12 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 33 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 19 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 78 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 17 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 20 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Execution timed out 3096 ms 256 KB Time limit exceeded
29 Execution timed out 3078 ms 384 KB Time limit exceeded
30 Execution timed out 3031 ms 256 KB Time limit exceeded