# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
228985 | 2020-05-03T08:23:34 Z | bharat2002 | Xylophone (JOI18_xylophone) | C++14 | 5 ms | 384 KB |
#include<bits/stdc++.h> #include "xylophone.h" using namespace std; const int N=1e5+10; int arr[N], ans[N]; void solve(int n) { for(int i=2;i<=n;i++) { arr[i]=query(i-1, i); } int ind; for(int i=2;i<=n;i++) { int temp=query(1, i); if(temp==n-1) {ans[i]=n;ind=i;break;} } for(int i=ind+1;i<=n;i++) { ans[i]=ans[i-1]+arr[i]; } for(int i=ind-1;i>=1;i--) { ans[i]=ans[i+1]-arr[i]; } for(int i=1;i<=n;i++) answer(i, ans[i]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Wrong Answer [7] |
2 | Halted | 0 ms | 0 KB | - |