Submission #819891

#TimeUsernameProblemLanguageResultExecution timeMemory
819891OzyBoat (APIO16_boat)C++17
9 / 100
2 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define lli long long int #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " #define rep(i,a,b) for(int i = (a); i <= (b); i++) #define repa(i,a,b) for(int i = (a); i >= (b); i--) #define pll pair<lli,lli> #define MAX 500 #define mod 1000000007 lli n,a,b,dp[MAX+2],res,v[MAX+2]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n; rep(i,1,n) { cin >> a >> b; v[i] = a; } dp[0] = 1; rep(i,1,n) { repa(j,i-1,0) if (v[j] < v[i]) dp[i] += dp[j]; res += dp[i]; dp[i] %= mod; res %= mod; } cout << res; 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...