# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
291751 | crossing0ver | Arcade (NOI20_arcade) | C++17 | 18 ms | 640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int n,m;
main() {
cin >> n >> m;
vector<pair<int,int> > v(m);
for (int i = 0; i < m; i++) {
int a,b;
cin >> v[i].first;
// v.push_back({-a-b,-b+a});
}
for (int i = 0;i < m ;i ++) {
cin >> v[i].second;
v[i] = {-v[i].first - v[i].second,v[i].first - v[i].second};
}
sort(v.begin(),v.end());
vector<int> sub;
for (auto i : v) {
int x = i.second;
auto it = lower_bound(sub.begin(),sub.end(),x);
if (it == sub.end()) sub.push_back(x);
else *it = x;
}
cout << sub.size();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |