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>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 510;
const ll mod = 1e9 + 7;
ll dp[maxn], n;
ll a[maxn], b[maxn];
int main() {
cin>>n;
for(int i=1;i<=n;i++) {
cin>>a[i]>>b[i];
}
dp[0] = 1LL;
ll result = 0LL;
for(int i=1;i<=n;i++) {
for(int j=0;j<i;j++) {
if(a[i] > a[j]) dp[i] += dp[j];
dp[i] %= mod;
}
result += dp[i];
result %= mod;
}
cout<<result<<"\n";
}
# | 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... |