Submission #40871

# Submission time Handle Problem Language Result Execution time Memory
40871 2018-02-09T15:23:26 Z gabrielsimoes Boat (APIO16_boat) C++14
0 / 100
2 ms 488 KB
#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);
}

Compilation message

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 time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -