Submission #811694

#TimeUsernameProblemLanguageResultExecution timeMemory
811694vjudge1Triple Jump (JOI19_jumps)C++14
5 / 100
16 ms2716 KiB
#include<bits/stdc++.h> #define fi first #define se second #define ll long long using namespace std ; const int N = 5e5 ; int n, q, d[N + 1] ; signed main() { ios_base::sync_with_stdio( 0 ) ; cin.tie( 0 ) ; cout.tie( 0 ) ; cin >> n ; for(int i = 1 ; i <= n ; i++) cin >> d[i] ; cin >> q ; if(n <= 100 && q <= 100) { while(q--) { int l, r, ans = 0 ; cin >> l >> r ; for(int b = l + 1 ; b < r ; b++) for(int a = l ; a < b ; a++) for(int c = b + (b - a) ; c <= r ; c++) ans = max(ans, d[a] + d[b] + d[c]) ; cout << ans << '\n' ; } return 0 ; } return 0 ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...