This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |