제출 #106955

#제출 시각아이디문제언어결과실행 시간메모리
106955maksim_gaponovBoat (APIO16_boat)C++14
0 / 100
4 ms428 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...