제출 #525246

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

컴파일 시 표준 에러 (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: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 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...