Submission #763357

#TimeUsernameProblemLanguageResultExecution timeMemory
763357vjudge1Financial Report (JOI21_financial)C++17
5 / 100
41 ms3680 KiB
// #cheat_when_I_was_young // #cheatkhitacontre #khionhatoicheat // #thaycuckythatvong #include "bits/stdc++.h" using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) //#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx2,popcnt,lzcnt,abm,bmi,bmi2,fma") const int NM = 3e5 + 5; int n, d, a[NM]; vector<int> lis; signed main() { IOS; cin >> n >> d; for (int i = 1; i <= n; ++i) cin >> a[i]; if (d == n) { for (int i = 1; i <= n; ++i) { if (!lis.size() || lis.back() < a[i]) lis.push_back(a[i]); else *lower_bound(lis.begin(), lis.end(), a[i]) = a[i]; } cout << lis.size(); } }
#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...