Submission #636803

# Submission time Handle Problem Language Result Execution time Memory
636803 2022-08-30T08:47:50 Z lovrot Boat (APIO16_boat) C++11
0 / 100
0 ms 212 KB
#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 = 2;
	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;
}

Compilation message

boat.cpp: In function 'int main()':
boat.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
boat.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 time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -