제출 #524347

#제출 시각아이디문제언어결과실행 시간메모리
524347veosHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++11
8 / 100
3084 ms6220 KiB
#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]);
	}
	for(int y=0;y<m;y++){
		bool w=true;
		int l,r,k;
		scanf("%d %d %d",&l,&r,&k);
		for(int i=l;w&&i<r;i++){
			for(int j=i+1;w&&j<=r;j++){
				if(b[i]>b[j]&&k<b[i]+b[j]){
					w=false;
				}
			}    
		}
		printf("%d\n", w);
	}
} 

컴파일 시 표준 에러 (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:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%d %d %d",&l,&r,&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...