답안 #498594

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
498594 2021-12-25T15:28:39 Z Ziyoda Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
0 / 100
3000 ms 8484 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int n, m;
	cin >> n >> m;
	long long a[n+1], b, mx=0, li, ri, ki;
	for(int i=1; i<=n; i++)
		cin >> a[i];
	for(int i=1; i<=m; i++){
		bool y=0;
		b = 0;
		cin >> li >> ri >> ki;
		for(int e=li; e<=ri; e++){
			if(e!=ri && y==0 && a[e]>a[e+1]){
				y=1; b=a[e];	}
			if(y && a[e]<b)
				mx = max(a[e], mx);
		}
		//cout << b << ' ' << mx << "\n";
		if(b+mx>ki)
			cout << 0 << "\n";
		else
			cout << 1 << "\n";
		mx = 0;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Incorrect 1 ms 244 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Incorrect 1 ms 244 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3066 ms 8484 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3046 ms 1428 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Incorrect 1 ms 244 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Incorrect 1 ms 244 KB Output isn't correct
4 Halted 0 ms 0 KB -