Submission #957023

#TimeUsernameProblemLanguageResultExecution timeMemory
957023Charizard2021Global Warming (CEOI18_glo)C++17
10 / 100
64 ms3032 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n, x; cin >> n >> x; int a[n]; for(int i = 0;i < n; i++) cin >> a[i]; if(x == 0){ vector<int> dp; for(int i = 0; i < n; i++){ int idx = lower_bound(dp.begin(), dp.end(), a[i]) - dp.begin(); if(idx == (int)dp.size()){ dp.push_back(a[i]); } else{ dp[idx] = a[i]; } } cout << dp.size() << "\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...
#Verdict Execution timeMemoryGrader output
Fetching results...