답안 #503213

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
503213 2022-01-07T14:15:50 Z AzamatRustamov Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
3000 ms 15200 KB
#include <iostream>
using namespace std;

bool solve(int n, int m, int w[])
{
	int l, r, k;
	cin >> l >> r >> k;
	for (int i=r; i>l; i--)
	{
		int a = w[i-1], b = w[i];
		if (a>b && a+b>k) return 0;
	}
	return 1;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n, m;
	cin >> n >> m;
	int w[n+1] = {-1};
	for (int i=1; i<=n; i++) {
		cin >> w[i];	
	}
	for (int i=0; i<m; i++) {
		cout << solve(n, m, w) << '\n';	
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 468 ms 7836 KB Output is correct
2 Correct 534 ms 13280 KB Output is correct
3 Correct 498 ms 15200 KB Output is correct
4 Correct 534 ms 13972 KB Output is correct
5 Execution timed out 3092 ms 8452 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2129 ms 2104 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -