답안 #503156

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
503156 2022-01-07T11:50:39 Z AzamatRustamov Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
0 / 100
3000 ms 31668 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 1 ms 312 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 312 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 487 ms 7656 KB Output is correct
2 Correct 533 ms 31668 KB Output is correct
3 Correct 533 ms 18432 KB Output is correct
4 Correct 535 ms 31296 KB Output is correct
5 Execution timed out 3075 ms 8472 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2097 ms 2880 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 312 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 312 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -