Submission #30799

#TimeUsernameProblemLanguageResultExecution timeMemory
30799inqrBoat (APIO16_boat)C++14
0 / 100
3 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;
	return 0;
}

Compilation message (stderr)

boat.cpp: In function 'int main()':
boat.cpp:28:30: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("boat.in","r",stdin);
                              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...