# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834287 | HollaFoil | Arcade (NOI20_arcade) | C++14 | 0 ms | 212 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 main() {
int n, m;
cin >> n >> m;
vector<int> times(m);
vector<int> locations(m);
vector<pair<int, int>> rotated(m);
for (int i = 0; i < m; i++) cin >> times[i];
for (int i = 0; i < m; i++) cin >> locations[i];
for (int i = 0; i < m; i++) rotated[i] = make_pair(times[i]+locations[i], times[i]-locations[i]);
sort(rotated.begin(), rotated.end());
vector<int> antichain;
for (int i = 0; i < m; i++) {
auto it = upper_bound(antichain.begin(), antichain.end(), rotated[i].second);
int offset = (int)(it-antichain.begin());
if (offset == antichain.size()) antichain.push_back(rotated[i].second);
else antichain[offset] = rotated[i].second;
}
cout << antichain.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... |