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 pb push_back
#define mp make_pair
#define rt insert
#define st first
#define nd second
#define ll long long
#define pii pair < int , int >
#define DB printf("debug\n");
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define all(x) x.begin() , x.end()
using namespace std;
int n;
ll ans=0,mod=1e9+7;
int a[505],b[505];
void solve1(int sn,int mtn){
if(sn==n){
ans++;
return;
}
ans%=mod;
solve1(sn+1,mtn);
if(mtn<a[sn])solve1(sn+1,a[sn]);
}
int main(){
cin.tie(0);ios_base::sync_with_stdio(0);
//freopen("boat.in","r",stdin);
//freopen(".out","w",stdout);
cin>>n;
for(int i=0;i<n;i++)cin>>a[i]>>b[i];
solve1(0,0);
cout<<ans<<endl;
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... |