Submission #898097

#TimeUsernameProblemLanguageResultExecution timeMemory
898097LitusianoHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
13 / 100
2626 ms49968 KiB
#include<bits/stdc++.h> using namespace std; #define endl '\n' int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n,q; cin>>n>>q; vector<int> v(n); for(int& i : v) cin>>i; vector<int> pre(n+1); for(int i = 1; i<n; i++){ pre[i+1] = pre[i] + (v[i] < v[i-1]); } for(int i : pre) cerr<<i<<" "; cerr<<endl; while(q--){ int l,r,k; cin>>l>>r>>k; if(pre[r] - pre[l] == 0) cout<<1<<endl; else cout<<0<<endl; } }

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:15:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   15 |   for(int i : pre) cerr<<i<<" "; cerr<<endl;
      |   ^~~
sortbooks.cpp:15:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   15 |   for(int i : pre) cerr<<i<<" "; cerr<<endl;
      |                                  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...