제출 #40871

#제출 시각아이디문제언어결과실행 시간메모리
40871gabrielsimoesBoat (APIO16_boat)C++14
0 / 100
2 ms488 KiB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD = 1000000007;
const int MAXN = 510;

int n;
int va[MAXN], vb[MAXN];
ll dp[MAXN];

int main() {
	va[0] = vb[0] = 0;
	dp[0] = 1;

	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d %d", &va[i], &vb[i]);
	}

	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int k = 0; k < i; k++) {
			if (va[k] < va[i]) {
				dp[i] += dp[k];
			}
		}
		ans += dp[i];
	}

	printf("%lld\n", ans);
}

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

boat.cpp: In function 'int main()':
boat.cpp:16:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
boat.cpp:18:33: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &va[i], &vb[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...