Submission #1092680

#TimeUsernameProblemLanguageResultExecution timeMemory
10926804QT0RHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3045 ms8016 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll wej[1000003]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll n,m; cin >> n >> m; for (ll i = 1; i<=n; i++){ cin >> wej[i]; } for (ll i = 1,a,b,c; i<=m; i++){ cin >> a >> b >> c; ll mx=0; for (ll j = a; j<=b; j++){ for (ll u = j; u<=b; u++){ if (wej[j]>wej[u])mx=max(mx,wej[j]+wej[u]); } } if (c>=mx)cout << "1\n"; else cout << "0\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...