Submission #154095

#TimeUsernameProblemLanguageResultExecution timeMemory
154095beso123Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
17 / 100
3038 ms43128 KiB
#include<bits/stdc++.h> #define ll long long #define x first #define y second using namespace std; vector<ll>a; int main(){ ll n,m; scanf("%lld%lld",&n,&m); a.resize(n+1); for (ll i=1;i<=n;i++) { scanf("%lld",&a[i]); } for (ll i=1;i<=m;i++) { ll l,r,k; scanf("%lld%lld%lld",&l,&r,&k); if (m>1000000 && n>1000000) { printf("%d\n",1); continue; } ll mx=a[l],ind=1; for (ll j=l+1;j<=r;j++) { if (mx>a[j]) { if (mx+a[j]>k) { ind=0; printf("%d\n",0); break; } } else mx=a[j]; } if (ind) printf("%d\n",1); } return 0;}

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:9:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%lld%lld",&n,&m);
 ~~~~~^~~~~~~~~~~~~~~~~~
sortbooks.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld",&a[i]);
   ~~~~~^~~~~~~~~~~~~~
sortbooks.cpp:19:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%lld%lld%lld",&l,&r,&k);
 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#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...