Submission #344071

#TimeUsernameProblemLanguageResultExecution timeMemory
344071koketsuHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
8 / 100
3091 ms53356 KiB
#include <bits/stdc++.h> #define pb push_back #define LL long long #define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; const LL Mxn = 1e6 + 7; const LL Mod = 1e9 + 7; const LL Inf = 1e14 + 7; set <int> A[Mxn]; int N, M, T[Mxn]; int main() { Kultivator; cin >> N >> M; for(int i = 1; i <= N; i++){ cin >> T[i]; } while(M--){ int L, R, K; bool Ok = false; cin >> L >> R >> K; for(int i = L; i < R; i++){ for(int j = i + 1; j <= R; j++){ if(T[i] > T[j] && T[i] + T[j] > K){ Ok = true; break; } } if(Ok) break; } if(Ok) cout << 0 << '\n'; else cout << 1 << '\n'; } }
#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...