답안 #1097244

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1097244 2024-10-06T14:42:58 Z nqthanhhai 3단 점프 (JOI19_jumps) C++17
5 / 100
4000 ms 3420 KB
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FOD(i, a, b) for (int i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()
#define nqthanhhai signed main()
#define file(name) if (fopen(name".inp", "r")) { freopen(name".inp","r", stdin); freopen(name".out", "w", stdout); }
#define el '\n'
#define ll long long 
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define fi first 
#define se second

const ll ar=1e6;
using namespace std;
ll n,l,r,t,a[ar],res=0;

nqthanhhai
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n;
    FOR (i,1,n){
        cin>>a[i];
    }
    cin>>t;
    while (t--){
        res=0;
        cin>> l >>r ;
        FOR (x,l,r-2){
            FOR (y, x+1, r-1){
                FOR  (z, y+(y-x),r){
                    res=max(res,a[x]+a[y]+a[z]);
                }
            }
        }
        cout<<res<<el;
    }
    cerr<<"Time elapsed: "<<TIME<<"s. \n";
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 464 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 464 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 4061 ms 604 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 4049 ms 3420 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 464 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Execution timed out 4061 ms 604 KB Time limit exceeded
12 Halted 0 ms 0 KB -