# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284856 | 3zp | Arcade (NOI20_arcade) | C++14 | 982 ms | 18012 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>
#define ll long long
using namespace std;
int x[500009],y[500009];
main(){
int m, n;
vector<pair<int,int> > V;
cin >> m >> n;
for(int i = 1; i <= n; i++){
cin >> x[i];
}
for(int i = 1; i <= n; i++){
cin >> y[i];
int u = x[i] + y[i];
int v = x[i] - y[i];
V.push_back({u, v});
}
sort(V.begin(),V.end());
multiset<int> S;
for(int i = 0; i < V.size(); i++){
int x = V[i].second;
auto it = S.lower_bound(x+1);
if(it == S.begin()){
S.insert(x);
continue;
}
it--;
S.erase(it);
S.insert(x);
}
cout<<S.size()<<endl;
}
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... |