Submission #941553

#TimeUsernameProblemLanguageResultExecution timeMemory
941553PlayVoltzTriple Jump (JOI19_jumps)C++17
5 / 100
4065 ms3164 KiB
#include <iostream> #include <map> #include <vector> #include <climits> #include <stack> #include <string> #include <queue> #include <algorithm> #include <set> #include <unordered_set> #include <unordered_map> #include <cmath> #include <cctype> #include <bitset> #include <iomanip> #include <cstring> #include <numeric> using namespace std; #define int long long #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define se second int32_t main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, q, a, b; cin>>n; vector<int> vect(n+1); for (int i=1; i<=n; ++i)cin>>vect[i]; cin>>q; while (q--){ cin>>a>>b; int res=0; for (int i=a; i<=b; ++i)for (int j=i+1; j<=b; ++j)for (int l=2*j-i; l<=b; ++l)res=max(res, vect[i]+vect[j]+vect[l]); cout<<res<<"\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...