Submission #274642

#TimeUsernameProblemLanguageResultExecution timeMemory
274642johuthaArcade (NOI20_arcade)C++17
100 / 100
212 ms20344 KiB
#include <iostream> #include <vector> #include <algorithm> #define int int64_t using namespace std; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector<pair<int,int>> ip(m); for (int i = 0; i < m; i++) cin >> ip[i].first; for (int i = 0; i < m; i++) cin >> ip[i].second; for (int i = 0; i < m; i++) ip[i] = make_pair(ip[i].first + ip[i].second, ip[i].first - ip[i].second); sort(ip.begin(), ip.end()); vector<int> ls(m + 1, (int)1e9); for (int i = 0; i < m; i++) { int v = -ip[i].second; *lower_bound(ls.begin(), ls.end(), v) = v; } cout << m + 1 - count(ls.begin(), ls.end(), (int)1e9) << "\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...