Submission #1011683

#TimeUsernameProblemLanguageResultExecution timeMemory
1011683ezzzayXylophone (JOI18_xylophone)C++17
0 / 100
0 ms596 KiB
#include "xylophone.h" #include<bits/stdc++.h> using namespace std; int A[5000]; void solve(int N) { int n=N; int x=1; int l=x-1,r=x+1; while(l>0){ if(l==x-1){ int p=query(l,x); A[l]=1+p; } else{ int p=query(l,x); if(p>=A[l+1]){ A[l]=1+p; } else{ A[l]=A[l+1]-p; } } l--; } while(r<=n){ if(r==x+1){ int p=query(x,r); A[r]=1+p; } else{ int p=query(x,r); if(p>=A[r-1]){ A[r]=1+p; } else{ A[r]=A[r-1]-p; } } r++; } 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...