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;
#define ll long long
const ll mod = 1e9+7;
const int mxn = 550;
ll dp[mxn];
int N;
int arr[mxn];
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>N;
for(int i = 1;i<=N;i++)cin>>arr[i]>>arr[i];
dp[0] = 1;
ll ans = 0;
for(int i = 1;i<=N;i++){
for(int j = i-1;j>=0;j--){
if(arr[j]<arr[i])dp[i] += dp[j];
}
dp[i] %= mod;
ans += dp[i];
}
cout<<(ans%=mod)<<'\n';
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... |