답안 #525243

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
525243 2022-02-11T07:31:56 Z veos Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++11
17 / 100
3000 ms 13096 KB
#include <stdio.h>
using namespace std;
int main(){
	int n,m;
	scanf("%d %d",&n,&m);
	int b[n++];
	b[0]=0;
	for(int i=1;i<n;i++)
		scanf("%d",&b[i]);
p:
	int c=b[0];
	int r,l,k;
	bool f = true;
	scanf("%d %d %d",&r,&l,&k);
	for(int i=r; f && i<=l;i++){
		if(c>b[i])
		{
			if(c+b[i]>k)
				f=false;
		}
		else
			c=b[i];
	}
	printf("%d\n",f);
	m--;
	if(m>0)
		goto p;
}

Compilation message

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:5:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |  scanf("%d %d",&n,&m);
      |  ~~~~~^~~~~~~~~~~~~~~
sortbooks.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%d",&b[i]);
      |   ~~~~~^~~~~~~~~~~~
sortbooks.cpp:14:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |  scanf("%d %d %d",&r,&l,&k);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 280 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 280 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 280 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 280 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 2 ms 292 KB Output is correct
12 Correct 3 ms 268 KB Output is correct
13 Correct 3 ms 332 KB Output is correct
14 Correct 5 ms 332 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 11 ms 332 KB Output is correct
17 Correct 10 ms 332 KB Output is correct
18 Correct 10 ms 292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 560 ms 6208 KB Output is correct
2 Correct 575 ms 13096 KB Output is correct
3 Correct 548 ms 11248 KB Output is correct
4 Correct 557 ms 11324 KB Output is correct
5 Execution timed out 3031 ms 13008 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 580 ms 836 KB Output is correct
2 Correct 1781 ms 1300 KB Output is correct
3 Execution timed out 3066 ms 1328 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 280 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 280 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 2 ms 292 KB Output is correct
12 Correct 3 ms 268 KB Output is correct
13 Correct 3 ms 332 KB Output is correct
14 Correct 5 ms 332 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 11 ms 332 KB Output is correct
17 Correct 10 ms 332 KB Output is correct
18 Correct 10 ms 292 KB Output is correct
19 Correct 2096 ms 2060 KB Output is correct
20 Correct 2163 ms 1864 KB Output is correct
21 Execution timed out 3056 ms 1812 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 280 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 280 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 2 ms 292 KB Output is correct
12 Correct 3 ms 268 KB Output is correct
13 Correct 3 ms 332 KB Output is correct
14 Correct 5 ms 332 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 11 ms 332 KB Output is correct
17 Correct 10 ms 332 KB Output is correct
18 Correct 10 ms 292 KB Output is correct
19 Correct 560 ms 6208 KB Output is correct
20 Correct 575 ms 13096 KB Output is correct
21 Correct 548 ms 11248 KB Output is correct
22 Correct 557 ms 11324 KB Output is correct
23 Execution timed out 3031 ms 13008 KB Time limit exceeded
24 Halted 0 ms 0 KB -