답안 #168062

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168062 2019-12-11T08:43:32 Z spartan_enkh Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
0 / 100
3000 ms 2040 KB
#include<bits/stdc++.h>
#define max_n 200005

using namespace std;

int main(){
	int n,m,i,k,j,l,r;
	int a[max_n];
	
	cin >> n >> m;
	for(i=1;i<=n;i++){
		cin >> a[i];
	}
	for(i=1;i<=m;i++){
		int ans=1;
		cin >> l >> r >> k;
		for(j=1;j<=r;j++){
			for(int l=j+1;l<=r;l++){
				if(a[j]>a[l] && a[j]+a[l]>k){
					ans=0;
					break;
				}
			}
			if(!ans) break;
		}
		cout << ans << endl;
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 4 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 4 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 149 ms 2040 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3056 ms 636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 4 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 4 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -