Submission #1027378

#TimeUsernameProblemLanguageResultExecution timeMemory
1027378stdfloatBoat (APIO16_boat)C++17
9 / 100
2 ms604 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const int md = (int)1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); 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); for (int i = 0; i < n; i++) { dp[i] = 1; for (int j = 0; j < i; j++) { if (a[j] < a[i]) dp[i] = (dp[i] + dp[j]) % md; } } ll sm = 0; for (auto i : dp) sm = (sm + i) % md; cout << sm; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...