Submission #1096685

#TimeUsernameProblemLanguageResultExecution timeMemory
1096685nguyenvuGlobal Warming (CEOI18_glo)C++14
10 / 100
23 ms1760 KiB
#include <bits/stdc++.h> #define ll long long #define i2 pair<ll,ll> using namespace std; int n,x; int a[200007]; namespace sub2 { bool check() { return x == 0; } vector<int> b; void solve() { for (int i=1; i<=n; i++) { auto it = lower_bound(b.begin(),b.end(),a[i]); if (it == b.end()) b.push_back(a[i]); else *it = a[i]; } cout << b.size(); } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> x; for (int i=1; i<=n; i++) { cin >> a[i]; } if (sub2::check()) { sub2::solve(); return 0; } 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...