Submission #945002

#TimeUsernameProblemLanguageResultExecution timeMemory
945002bngybongybrdTriple Jump (JOI19_jumps)C++17
0 / 100
4046 ms2652 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n, q; int arr[500005]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for(int i = 0; i < n; i++) cin >> arr[i]; cin >> q; for(int i = 0; i < q; i++){ int maxm = 0; int l, r; cin >> l >> r; for(int x = l-1; x < (r-2); x++){ for(int j = x+1; j < ((l+r)/2); j++){ for(int y = (j-x)+j; y < r; y++){ //cout << arr[x]+arr[j]+arr[y] << "\n"; maxm = max(maxm, arr[x]+arr[j]+arr[y]); } } } cout << maxm << "\n"; } 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...