제출 #525243

#제출 시각아이디문제언어결과실행 시간메모리
525243veosHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++11
17 / 100
3066 ms13096 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...