제출 #169070

#제출 시각아이디문제언어결과실행 시간메모리
169070abilHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
0 / 100
3036 ms10104 KiB
#include <bits/stdc++.h>

#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define all(s) s.begin(),s.end()
#define int long long

using namespace std;

const int N = (1e6 + 12);
const int mod = (1e9 + 7);
const int INF = (0x3f3f3f3f);

int a[N];

main()
{
	int n, m; 
	scanf("%lld%lld", &n, &m);
	for(int i = 1;i <= n; i++){
		scanf("%d", &a[i]);
	}
	int l, r, mood;
	while(m--){
		scanf("%lld%lld%lld", &l, &r, &mood);
		int ok = 1;
		for(int i = l;i <= r; i++){
			for(int j = l + 1;j <= r; j++){
				if(a[i] + a[j] > mood && a[i] > a[j]){
					ok = 0;
					break;
				}
			}
			if(!ok){
				break;
			}
		}
		printf("%lld\n", ok);
	}
}

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

sortbooks.cpp:18:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
sortbooks.cpp: In function 'int main()':
sortbooks.cpp:23:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   scanf("%d", &a[i]);
               ~~~~~^
sortbooks.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld%lld", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~~~~~
sortbooks.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a[i]);
   ~~~~~^~~~~~~~~~~~~
sortbooks.cpp:27:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld%lld%lld", &l, &r, &mood);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...