Submission #274626

#TimeUsernameProblemLanguageResultExecution timeMemory
274626johuthaArcade (NOI20_arcade)C++17
0 / 100
1 ms256 KiB
#include <iostream> #include <vector> #include <algorithm> #define int int64_t using namespace std; signed main() { 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); ls[0] = 0; for (int i = 0; i < m; i++) { int v = -ip[i].second; *lower_bound(ls.begin(), ls.end(), v) = v; } cout << m - 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...