Submission #30800

# Submission time Handle Problem Language Result Execution time Memory
30800 2017-07-26T14:24:16 Z inqr Boat (APIO16_boat) C++14
0 / 100
2000 ms 2184 KB
#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
1 Execution timed out 2000 ms 2184 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2000 ms 2184 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2000 ms 2184 KB Execution timed out
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2000 ms 2184 KB Execution timed out
2 Halted 0 ms 0 KB -