Submission #565753

#TimeUsernameProblemLanguageResultExecution timeMemory
565753DodoXylophone (JOI18_xylophone)C++14
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #define ll long long #define endl '\n' #define pb push_back using namespace std; const ll mx=100006; #include "xylophone.h" static int A[5000]; void solve(int N) { int n=N; int r=n-1,op=2; int value = query(1, N-1); while(1<r&&value!=n-1) { r--; value = query(1, r); if(value!=n-1)op=r+1; } A[op]=1; for(int i = 1; i <= n; i++) { if(i==op)continue; ll x=query(min(op,i), max(op,i)); A[i]=1+x; } for(int i=1;i<=n;i++) { answer(i,A[i]); } } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...