제출 #1292565

#제출 시각아이디문제언어결과실행 시간메모리
1292565goulthenBoat (APIO16_boat)C++20
9 / 100
2 ms656 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pii pair<int, int> #define fi first #define se second #define rep(i, a, b) for (int i = a; i <= b; ++i) #define per(i, b, a) for (int i = b; i >= a; --i) #define pb push_back #define all(v) (v).begin(), (v).end() const int MAXN = 5e2+10; const int MOD = 1e9+7; int l[MAXN], r[MAXN], dp[MAXN]; int32_t main() { ios_base::sync_with_stdio(0);cin.tie(nullptr); int n;cin >> n; rep(i,1,n) cin >> l[i] >> r[i]; int ans = 0LL; rep(i,1,n) { dp[i] = 1; per(j,i-1,1) { if(l[i] > l[j]) dp[i] = (dp[i]+dp[j])%MOD; } ans = (ans+dp[i])%MOD; } cout << ans << '\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...