제출 #539761

#제출 시각아이디문제언어결과실행 시간메모리
539761rk42745417Financial Report (JOI21_financial)C++17
5 / 100
67 ms5580 KiB
#include <bits/stdc++.h> using namespace std; #define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0); using ll = int64_t; using ull = uint64_t; using uint = uint32_t; using ld = long double; const int INF = 0x3f3f3f3f; const ll LINF = ll(4e18) + ll(2e15); const int MOD = 1e9 + 7; const double EPS = 1e-9; static int LamyIsCute = []() { EmiliaMyWife return 48763; }(); signed main() { int n, d; cin >> n >> d; assert(d == n); vector<int> arr(n); for(int &a : arr) cin >> a; vector<int> dp(n + 1, INF); dp[0] = -1; int ans = 0; for(int a : arr) { int it = lower_bound(dp.begin(), dp.end(), a) - dp.begin(); ans = max(ans, it); dp[it] = min(dp[it], a); } 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...