답안 #1071291

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1071291 2024-08-23T06:35:28 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++
8 / 100
3000 ms 43092 KB
// Balgabaev Mansur
#include <bits/stdc++.h>

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
#define pb push_back
#define int long long


using namespace std;

const int N=1e6+7;
const int MOD=1e9+7;
const int INF=1e18;

int binpow (int a, int n) {
	if (n == 0)
		return 1;
	if (n % 2 == 1)
		return binpow (a, n-1) * a;
	else {
		int b = binpow (a, n/2);
		return b * b;
	}
}

int a[N];

void solve(){
	int n,m;
	cin >> n >> m;
	for(int i = 1 ; i <= n ; i++){
		cin >> a[i];
	}
	for(int tt = 1 ; tt <= m ; tt++){
		int l,r,k;
		cin >> l >> r >> k;
		bool ok=true;
		for(int i = l ; i < r ; i++){
			for(int j = i+1 ; j <= r ; j++){
				if(a[i]+a[j] > k and a[i] > a[j]){
					ok=false;
					break;
				}
			}
			if(!ok){
				break;
			}
		}
		cout << ok << '\n';
	}
}	
 
signed main() {
   // freopen("closing.in", "r", stdin);
   // freopen("closing.out", "w", stdout);
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int test = 1,cntx=1;
    //cin >> test;
    while (test--) {
	//cout << "Case " << 	cntx << ':' << '\n';
        solve();
        cntx++;
	}		
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 600 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 23 ms 348 KB Output is correct
9 Correct 9 ms 348 KB Output is correct
10 Correct 8 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 600 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 23 ms 348 KB Output is correct
9 Correct 9 ms 348 KB Output is correct
10 Correct 8 ms 348 KB Output is correct
11 Correct 7 ms 348 KB Output is correct
12 Correct 40 ms 348 KB Output is correct
13 Correct 27 ms 608 KB Output is correct
14 Correct 73 ms 652 KB Output is correct
15 Correct 41 ms 652 KB Output is correct
16 Execution timed out 3089 ms 348 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 328 ms 21328 KB Output is correct
2 Correct 326 ms 42992 KB Output is correct
3 Correct 346 ms 42848 KB Output is correct
4 Correct 323 ms 43092 KB Output is correct
5 Execution timed out 3058 ms 18056 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3068 ms 2652 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 600 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 23 ms 348 KB Output is correct
9 Correct 9 ms 348 KB Output is correct
10 Correct 8 ms 348 KB Output is correct
11 Correct 7 ms 348 KB Output is correct
12 Correct 40 ms 348 KB Output is correct
13 Correct 27 ms 608 KB Output is correct
14 Correct 73 ms 652 KB Output is correct
15 Correct 41 ms 652 KB Output is correct
16 Execution timed out 3089 ms 348 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 600 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 23 ms 348 KB Output is correct
9 Correct 9 ms 348 KB Output is correct
10 Correct 8 ms 348 KB Output is correct
11 Correct 7 ms 348 KB Output is correct
12 Correct 40 ms 348 KB Output is correct
13 Correct 27 ms 608 KB Output is correct
14 Correct 73 ms 652 KB Output is correct
15 Correct 41 ms 652 KB Output is correct
16 Execution timed out 3089 ms 348 KB Time limit exceeded
17 Halted 0 ms 0 KB -