Submission #525246

# Submission time Handle Problem Language Result Execution time Memory
525246 2022-02-11T07:37:08 Z veos Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++11
17 / 100
3000 ms 6116 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]);
	while(m--)
	{
		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);
	}
}

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:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d %d %d",&r,&l,&k);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 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 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 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 204 KB Output is correct
12 Correct 2 ms 204 KB Output is correct
13 Correct 3 ms 204 KB Output is correct
14 Correct 3 ms 204 KB Output is correct
15 Correct 4 ms 332 KB Output is correct
16 Correct 11 ms 204 KB Output is correct
17 Correct 10 ms 288 KB Output is correct
18 Correct 8 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 533 ms 6104 KB Output is correct
2 Correct 534 ms 6116 KB Output is correct
3 Correct 570 ms 6056 KB Output is correct
4 Correct 533 ms 6056 KB Output is correct
5 Execution timed out 3080 ms 4172 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 407 ms 920 KB Output is correct
2 Correct 1208 ms 900 KB Output is correct
3 Execution timed out 3069 ms 852 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 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 204 KB Output is correct
12 Correct 2 ms 204 KB Output is correct
13 Correct 3 ms 204 KB Output is correct
14 Correct 3 ms 204 KB Output is correct
15 Correct 4 ms 332 KB Output is correct
16 Correct 11 ms 204 KB Output is correct
17 Correct 10 ms 288 KB Output is correct
18 Correct 8 ms 204 KB Output is correct
19 Correct 1464 ms 1444 KB Output is correct
20 Correct 1575 ms 1424 KB Output is correct
21 Execution timed out 3068 ms 1132 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 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 204 KB Output is correct
12 Correct 2 ms 204 KB Output is correct
13 Correct 3 ms 204 KB Output is correct
14 Correct 3 ms 204 KB Output is correct
15 Correct 4 ms 332 KB Output is correct
16 Correct 11 ms 204 KB Output is correct
17 Correct 10 ms 288 KB Output is correct
18 Correct 8 ms 204 KB Output is correct
19 Correct 533 ms 6104 KB Output is correct
20 Correct 534 ms 6116 KB Output is correct
21 Correct 570 ms 6056 KB Output is correct
22 Correct 533 ms 6056 KB Output is correct
23 Execution timed out 3080 ms 4172 KB Time limit exceeded
24 Halted 0 ms 0 KB -