Submission #1015193

#TimeUsernameProblemLanguageResultExecution timeMemory
1015193UmairAhmadMirzaBoat (APIO16_boat)C++17
9 / 100
2 ms448 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int const N=505; int const mod=1e9+7; int dp[N]; int arr[N]; signed main(){ int n; cin>>n; for (int i = 1; i <=n; ++i) cin>>arr[i]>>arr[i]; for(int i=1;i<=n;i++){ dp[i]=1; for(int j=i-1;j>=1;j--) if(arr[j]<arr[i]){ dp[i]+=dp[j]; dp[i]%=mod; } } int ans=0; for(int i=1;i<=n;i++) ans=(ans+dp[i])%mod; 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...