#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 time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
596 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
596 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
596 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |