# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
497470 | 2021-12-23T06:32:21 Z | Nalrimet | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 0 ms | 204 KB |
#include <bits/stdc++.h> #pragma GCC optimization("g", on) #pragma GCC optimize ("inline") #pragma GCC optimization("03") #pragma GCC optimization("unroll-loops") #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #define ll long long #define pb push_back #define F first #define S second using namespace std; const int N = 1e6 + 5; const int inf = 1e9 + 7; int n, m, l, r, k, a[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m; for(int i = 1; i <= n; ++i){ cin >> a[i]; } while(m--){ cin >> l >> r >> k; bool ok = 1; for(int i = l; i < r; i++){ for(int j = i + 1; j <= r; j++){ if(a[i] > a[j]){ if(a[i] + a[j] > k){ ok = 0; break; } } } if(!ok) break; } cout << ok << '\n'; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |