Submission #490505

# Submission time Handle Problem Language Result Execution time Memory
490505 2021-11-27T16:47:39 Z fuad27 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
3000 ms 8124 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(arr[i] < MAX and 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 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 208 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 208 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3053 ms 8124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2181 ms 1532 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 208 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 2 ms 208 KB Output isn't correct
4 Halted 0 ms 0 KB -