Submission #344014

# Submission time Handle Problem Language Result Execution time Memory
344014 2021-01-05T04:34:58 Z juggernaut Library (JOI18_library) C++14
0 / 100
366 ms 620 KB
#include<bits/stdc++.h>
#include"library.h"
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
vector<int>g[205],ans;
void dfs(int v,int p){
    ans.push_back(v+1);
    for(int to:g[v])if(to!=p)dfs(to,v);
}
void Solve(int n){
    if(n>200)puts("LOL");
    vector<int>m(n,0);
    for(int i=0;i+1<n;i++){
        for(int j=i+1;j<n;j++){
            m[i]=m[j]=1;
            if(Query(m)==1){
                g[i].push_back(j);
                g[j].push_back(i);
            }
            m[i]=m[j]=0;
        }
    }
    int root;
    for(int i=0;i<n;i++)if(g[i].size()==1)root=i;
    dfs(root,root);
    Answer(ans);
}

Compilation message

library.cpp: In function 'void Solve(int)':
library.cpp:28:8: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
   28 |     dfs(root,root);
      |     ~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 222 ms 508 KB # of queries: 18336
2 Correct 263 ms 620 KB # of queries: 18145
3 Correct 269 ms 384 KB # of queries: 19900
4 Correct 366 ms 364 KB # of queries: 19900
5 Correct 226 ms 496 KB # of queries: 19900
6 Correct 260 ms 620 KB # of queries: 19900
7 Correct 275 ms 620 KB # of queries: 19900
8 Correct 314 ms 492 KB # of queries: 18528
9 Correct 308 ms 620 KB # of queries: 19701
10 Correct 81 ms 496 KB # of queries: 8256
11 Runtime error 1 ms 492 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 222 ms 508 KB # of queries: 18336
2 Correct 263 ms 620 KB # of queries: 18145
3 Correct 269 ms 384 KB # of queries: 19900
4 Correct 366 ms 364 KB # of queries: 19900
5 Correct 226 ms 496 KB # of queries: 19900
6 Correct 260 ms 620 KB # of queries: 19900
7 Correct 275 ms 620 KB # of queries: 19900
8 Correct 314 ms 492 KB # of queries: 18528
9 Correct 308 ms 620 KB # of queries: 19701
10 Correct 81 ms 496 KB # of queries: 8256
11 Runtime error 1 ms 492 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Halted 0 ms 0 KB -