제출 #941678

#제출 시각아이디문제언어결과실행 시간메모리
941678emptypringlescan3단 점프 (JOI19_jumps)C++17
5 / 100
4034 ms1884 KiB
#include <bits/stdc++.h> using namespace std; int32_t main(){ ios::sync_with_stdio(0);cin.tie(0); int n; cin >> n; long long arr[n]; for(int i=0; i<n; i++) cin >> arr[i]; int q; cin >> q; while(q--){ int l,r; cin >> l >> r; l--; r--; long long ans=0; for(int a=l; a<=r; a++){ for(int b=a+1; b<=r; b++){ for(int c=b*2-a; c<=r; c++) ans=max(ans,arr[a]+arr[b]+arr[c]); } } cout << ans << '\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...