Submission #106955

# Submission time Handle Problem Language Result Execution time Memory
106955 2019-04-21T10:23:22 Z maksim_gaponov Boat (APIO16_boat) C++14
0 / 100
4 ms 428 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll

void run() {
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i] >> b[i];
	}
	vector<int> dp(n, 1);
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < i; ++j) {
			if (a[i] > a[j]) {
				dp[i] += dp[j];
			}
		}
	}
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		ans += dp[i];
	}
	cout << ans << '\n';
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	run();
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -