Submission #967040

#TimeUsernameProblemLanguageResultExecution timeMemory
967040thinknoexitBoat (APIO16_boat)C++17
9 / 100
1 ms476 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 505; const ll MOD = 1e9 + 7; int a[N], b[N]; int dp[N]; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; int ans = 0; for (int i = 1;i <= n;i++) { cin >> a[i] >> b[i]; dp[i] = 1; for (int j = 1;j < i;j++) { if (a[j] < a[i]) dp[i] = (dp[i] + dp[j]) % MOD; } ans = (ans + dp[i]) % MOD; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...