Submission #526250

# Submission time Handle Problem Language Result Execution time Memory
526250 2022-02-14T04:34:57 Z veos Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++11
34 / 100
3000 ms 39084 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]);
do{
	int c=b[0];
	int r,l,k;
	bool f = true;
	scanf("%d %d %d",&r,&l,&k);
	for(int i=r; i<=l;i++){
		if(c>b[i])
		{
			if(c+b[i]>k){
				f=false;
				break;
			}
		}
		else
			c=b[i];
	}
	printf("%d\n",f);
	m--;
	}while(m>0);
}

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);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 272 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 272 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 1 ms 204 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 332 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 2 ms 288 KB Output is correct
14 Correct 3 ms 420 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 12 ms 332 KB Output is correct
17 Correct 11 ms 332 KB Output is correct
18 Correct 9 ms 288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 610 ms 37992 KB Output is correct
2 Correct 551 ms 39084 KB Output is correct
3 Correct 602 ms 38840 KB Output is correct
4 Correct 624 ms 39008 KB Output is correct
5 Execution timed out 3006 ms 14676 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 579 ms 2828 KB Output is correct
2 Correct 1833 ms 2688 KB Output is correct
3 Correct 1712 ms 2864 KB Output is correct
4 Correct 1227 ms 2836 KB Output is correct
5 Correct 921 ms 2828 KB Output is correct
6 Correct 1808 ms 2684 KB Output is correct
7 Correct 1803 ms 2716 KB Output is correct
8 Correct 2053 ms 2532 KB Output is correct
9 Correct 50 ms 1684 KB Output is correct
10 Correct 2538 ms 2408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 272 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 1 ms 204 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 332 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 2 ms 288 KB Output is correct
14 Correct 3 ms 420 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 12 ms 332 KB Output is correct
17 Correct 11 ms 332 KB Output is correct
18 Correct 9 ms 288 KB Output is correct
19 Correct 2206 ms 8000 KB Output is correct
20 Correct 2173 ms 7928 KB Output is correct
21 Execution timed out 3050 ms 5124 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 272 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 292 KB Output is correct
8 Correct 1 ms 204 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 332 KB Output is correct
12 Correct 3 ms 384 KB Output is correct
13 Correct 2 ms 288 KB Output is correct
14 Correct 3 ms 420 KB Output is correct
15 Correct 3 ms 332 KB Output is correct
16 Correct 12 ms 332 KB Output is correct
17 Correct 11 ms 332 KB Output is correct
18 Correct 9 ms 288 KB Output is correct
19 Correct 610 ms 37992 KB Output is correct
20 Correct 551 ms 39084 KB Output is correct
21 Correct 602 ms 38840 KB Output is correct
22 Correct 624 ms 39008 KB Output is correct
23 Execution timed out 3006 ms 14676 KB Time limit exceeded
24 Halted 0 ms 0 KB -