답안 #1093230

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1093230 2024-09-26T09:41:10 Z andrewp Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
8 / 100
3000 ms 14072 KB
//Dedicated to my love, ivaziva
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h> 
using namespace std;  
 
using pii = pair<int, int>;
using ll = int64_t;
 
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define dbg(x) cerr << #x << ": " << x << '\n'; 
 
int32_t main()  {
    ios::sync_with_stdio(false); cin.tie(nullptr);  
    cout.tie(nullptr); cerr.tie(nullptr);
 
    int n, q;
    cin >> n >> q;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    while (q--) {
        int l, r, k;
        cin >> l >> r >> k, l--, r--; 
        int ans = 0; 
        for (int i = l; i <= r; i++) {
            for (int j = i - 1; j >= l; j--) {
                if (a[j] > a[i]) {
                    ans = max(ans, a[i] + a[j]);
                    break;
                }
            }
        }
        cout << (ans <= k ? '1' : '0') << '\n';
    }
    return 0;   
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 8 ms 468 KB Output is correct
9 Correct 3 ms 348 KB Output is correct
10 Correct 5 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 8 ms 468 KB Output is correct
9 Correct 3 ms 348 KB Output is correct
10 Correct 5 ms 468 KB Output is correct
11 Correct 8 ms 344 KB Output is correct
12 Correct 21 ms 580 KB Output is correct
13 Correct 24 ms 348 KB Output is correct
14 Correct 44 ms 604 KB Output is correct
15 Correct 44 ms 600 KB Output is correct
16 Execution timed out 3007 ms 604 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3067 ms 14072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3046 ms 1620 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 8 ms 468 KB Output is correct
9 Correct 3 ms 348 KB Output is correct
10 Correct 5 ms 468 KB Output is correct
11 Correct 8 ms 344 KB Output is correct
12 Correct 21 ms 580 KB Output is correct
13 Correct 24 ms 348 KB Output is correct
14 Correct 44 ms 604 KB Output is correct
15 Correct 44 ms 600 KB Output is correct
16 Execution timed out 3007 ms 604 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 8 ms 468 KB Output is correct
9 Correct 3 ms 348 KB Output is correct
10 Correct 5 ms 468 KB Output is correct
11 Correct 8 ms 344 KB Output is correct
12 Correct 21 ms 580 KB Output is correct
13 Correct 24 ms 348 KB Output is correct
14 Correct 44 ms 604 KB Output is correct
15 Correct 44 ms 600 KB Output is correct
16 Execution timed out 3007 ms 604 KB Time limit exceeded
17 Halted 0 ms 0 KB -