Submission #30800

#TimeUsernameProblemLanguageResultExecution timeMemory
30800inqrBoat (APIO16_boat)C++14
0 / 100
2000 ms2184 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...