Submission #524858

# Submission time Handle Problem Language Result Execution time Memory
524858 2022-02-10T06:59:28 Z veos Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++11
8 / 100
3000 ms 12636 KB
#include <stdio.h>
using namespace std;
int main(){
	int m,n;
	scanf("%d %d",&n,&m);
	int b[n+1];
	b[0]=0;
	for(int i=1;i<=n;i++)
		scanf("%d",&b[i]);	
		
p:		int l,r,k;
		bool g=true;
		scanf("%d",&l);
		scanf("%d",&r);
		scanf("%d",&k);
		for(int i=l;g&&i<r;i++){
			for(int j=i+1;g&&j<=r;j++){
				if(b[i]>b[j]&&k<b[i]+b[j]){
				g=false;
				printf("%d\n",0);}
			}
		}
		m--;
		if(g==true)
		printf("%d\n",1);
		if(m>0){
			goto p;
		}
}
//Matchanov Muxammad

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:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d",&l);
      |   ~~~~~^~~~~~~~~
sortbooks.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%d",&r);
      |   ~~~~~^~~~~~~~~
sortbooks.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d",&k);
      |   ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 22 ms 284 KB Output is correct
9 Correct 7 ms 260 KB Output is correct
10 Correct 9 ms 276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 22 ms 284 KB Output is correct
9 Correct 7 ms 260 KB Output is correct
10 Correct 9 ms 276 KB Output is correct
11 Correct 19 ms 284 KB Output is correct
12 Correct 149 ms 288 KB Output is correct
13 Correct 92 ms 324 KB Output is correct
14 Correct 194 ms 432 KB Output is correct
15 Correct 127 ms 416 KB Output is correct
16 Execution timed out 3056 ms 328 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 746 ms 12452 KB Output is correct
2 Correct 771 ms 12636 KB Output is correct
3 Correct 671 ms 8424 KB Output is correct
4 Correct 671 ms 8476 KB Output is correct
5 Execution timed out 3020 ms 8232 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3008 ms 1180 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 22 ms 284 KB Output is correct
9 Correct 7 ms 260 KB Output is correct
10 Correct 9 ms 276 KB Output is correct
11 Correct 19 ms 284 KB Output is correct
12 Correct 149 ms 288 KB Output is correct
13 Correct 92 ms 324 KB Output is correct
14 Correct 194 ms 432 KB Output is correct
15 Correct 127 ms 416 KB Output is correct
16 Execution timed out 3056 ms 328 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 284 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 22 ms 284 KB Output is correct
9 Correct 7 ms 260 KB Output is correct
10 Correct 9 ms 276 KB Output is correct
11 Correct 19 ms 284 KB Output is correct
12 Correct 149 ms 288 KB Output is correct
13 Correct 92 ms 324 KB Output is correct
14 Correct 194 ms 432 KB Output is correct
15 Correct 127 ms 416 KB Output is correct
16 Execution timed out 3056 ms 328 KB Time limit exceeded
17 Halted 0 ms 0 KB -