제출 #168060

#제출 시각아이디문제언어결과실행 시간메모리
168060spartan_enkhHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
0 / 100
3049 ms4260 KiB
#include<bits/stdc++.h>
#define max_n 200005

using namespace std;

int main(){
	int n,m,i,k,j,l,r;
	int a[max_n];
	
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	for(i=1;i<=m;i++){
		int ans=1;
		scanf("%d%d%d",&l,&r,&k);
		for(j=1;j<=r;j++){
			for(int l=j+1;l<=r;l++){
				if(a[j]>a[l] && a[j]+a[l]>k){
					ans=0;
					break;
				}
			}
			if(!ans) break;
		}
		printf("%d\n",ans);
	}
	return 0;
}

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

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~
sortbooks.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a[i]);
   ~~~~~^~~~~~~~~~~~
sortbooks.cpp:16:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   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...