Submission #490504

#TimeUsernameProblemLanguageResultExecution timeMemory
490504fuad27Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
0 / 100
3071 ms8352 KiB
#include<bits/stdc++.h> using namespace std; const long long N = 1e6 + 10; int main () { int n, m; cin >> n >> m; long long arr[n]; for(int i = 0;i<n;i++)cin>>arr[i]; while(m--) { int l, r, m; cin >> l >> r >> m; long long MAX = 0, MIN = 1e18; bool check = true; for(int i = l-1;i<r;i++) { if(abs(MAX - arr[i]) > m) { check=0; } MAX = max(MAX, arr[i]); } cout << check << endl; } }

Compilation message (stderr)

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:12:28: warning: unused variable 'MIN' [-Wunused-variable]
   12 |         long long MAX = 0, MIN = 1e18;
      |                            ^~~
#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...