Submission #490504

# Submission time Handle Problem Language Result Execution time Memory
490504 2021-11-27T16:46:12 Z fuad27 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
3000 ms 8352 KB
#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

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 time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3071 ms 8352 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3062 ms 1572 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -