답안 #571433

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
571433 2022-06-02T08:06:46 Z AzamatRustamov Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
2719 ms 20488 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	int w[n];
	for (int i=0; i<n; i++) 
		cin >> w[i];
	while (m--)
	{
		int l, r, k, x, y=1;
		cin >> l >> r >> k;
		x = w[l];
		for (int i=l+1; i<=r; i++)
		{
			if (x > w[i] && x + w[i] > k)
			{
				y = 0;
				break;
			}
			else if (x < w[i]) x = w[i];
		}
		cout << y << '\n';
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 2 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 2 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2719 ms 20488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 921 ms 2792 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 2 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 2 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -