# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834288 | Liudas | Arcade (NOI20_arcade) | C++17 | 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 <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main(){
int N, M;
cin >> N >> M;
vector<pair<int, int>> arr(M);
for(int i = 0; i < M; i ++){
cin >> arr[i].first;
}
for(int i = 0; i < M; i ++){
cin >> arr[i].second;
}
for(int i = 0; i < M; i ++){
arr[i] = {arr[i].first + arr[i].second, arr[i].first - arr[i].second};
}
sort(arr.rbegin(), arr.rend());
vector<pair<int, int>> ans;
for(int i = 0; i < M; i ++){
int id = lower_bound(ans.begin(), ans.end(), arr[i])-ans.begin();
if(id != ans.size()){
ans[id] = arr[i];
}
else{
ans.push_back(arr[i]);
}
}
cout << ans.size() << endl;
return 0;
}
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... |