Submission #131700

#TimeUsernameProblemLanguageResultExecution timeMemory
131700someone_aaBoat (APIO16_boat)C++17
9 / 100
4 ms380 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; const int maxn = 510; const ll mod = 1e9 + 7; ll dp[maxn], n; ll a[maxn], b[maxn]; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]>>b[i]; } dp[0] = 1LL; ll result = 0LL; for(int i=1;i<=n;i++) { for(int j=0;j<i;j++) { if(a[i] > a[j]) dp[i] += dp[j]; dp[i] %= mod; } result += dp[i]; result %= mod; } cout<<result<<"\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...