Submission #565622

#TimeUsernameProblemLanguageResultExecution timeMemory
565622UzoufXylophone (JOI18_xylophone)C++14
0 / 100
1 ms208 KiB
#include "xylophone.h" #include <bits/stdc++.h> using namespace std; static int A[5000]; void solve(int N) { vector<int> pp; for (int i=1;i<=N;i++) pp.push_back(i); vector<int> nm; for (int i=1;i<N;i++) { nm.push_back(query(i,i+1)); } sort(pp.begin(),pp.end()); do { bool bl=true; for (int i=0;i<N;i++) { if (max(pp[i],pp[i-1])-min(pp[i],pp[i-1])!=nm[i-1]) bl=false; } if (bl) {break;} }while (next_permutation(pp.begin(),pp.end())); for(int i = 0; i < N; i++) { answer(i+1, pp[i]); } }

Compilation message (stderr)

xylophone.cpp:4:12: warning: 'A' defined but not used [-Wunused-variable]
    4 | static int A[5000];
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...