제출 #636800

#제출 시각아이디문제언어결과실행 시간메모리
636800lovrotFireworks (APIO16_fireworks)C++11
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> 

using namespace std; 

const int N = 510;

int n;
int a[N], b[N];

int main(){ 
	scanf("%d", &n);
	for(int i = 0; i < n; i++){ 
		scanf("%d%d", &a[i], &b[i]);
	}
	int ans = 1;
	for(int i = n - 2; i > -1; i--){ 
		// printf("%d\n", i);
		if(a[i] <= a[i + 1]) ans++;
		else break;
	}
	printf("%d\n", ans);
	return 0;
}

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

fireworks.cpp: In function 'int main()':
fireworks.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
fireworks.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d%d", &a[i], &b[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...