Submission #1020622

#TimeUsernameProblemLanguageResultExecution timeMemory
1020622pccBoat (APIO16_boat)C++17
9 / 100
1 ms604 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9+7; const int mxn = 550; ll dp[mxn]; int N; int arr[mxn]; int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>N; for(int i = 1;i<=N;i++)cin>>arr[i]>>arr[i]; dp[0] = 1; ll ans = 0; for(int i = 1;i<=N;i++){ for(int j = i-1;j>=0;j--){ if(arr[j]<arr[i])dp[i] += dp[j]; } dp[i] %= mod; ans += dp[i]; } cout<<(ans%=mod)<<'\n'; 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...