# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401479 | 2021-05-10T11:13:22 Z | victoriad | Library (JOI18_library) | C++14 | 4 ms | 200 KB |
#include <cstdio> #include <vector> #include "library.h" using namespace std; void Solve(int N) { vector<vector<int> >p(N); int f; for(int i=1;i<=N;i++){ vector<int> M(N,0); M[i-1]=1; for(int k=i+1;k<=N;k++){ M[k-1]=i; if(Query(M)==1){ p[i-1].push_back(k-1); p[k-1].push_back(i-1); } } if(p[i-1].size()==1)f=i-1; } vector<bool>c(N,false); vector<int> res(N); res[0]=f+1; c[f]=true; for(int i=1;i<N;i++){ for(int k=0;k<p[f].size();k++){ if(!c[p[f][k]]){ c[p[f][k]]=true; res[i]=p[f][k]+1; f=res[i]-1; break; } } } Answer(res); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 200 KB | Expected integer, but "wa" found |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 200 KB | Expected integer, but "wa" found |
2 | Halted | 0 ms | 0 KB | - |