# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
285105 | achibasadzishvili | Arcade (NOI20_arcade) | C++14 | 1 ms | 384 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
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<pair<ll,ll> >v;
ll n,m,t[500005],a[500005];
int main(){
ios::sync_with_stdio(false);
cin >> n >> m;
for(int i=1; i<=m; i++){
cin >> t[i];
}
for(int i=1; i<=m; i++){
cin >> a[i];
v.pb(mp(t[i] + a[i] , t[i] - a[i]));
}
sort(v.begin() , v.end());
multiset < int > s;
multiset < int > :: iterator it;
for(int i=0; i<v.size(); i++){
ll k = v[i].s;
s.insert(k);
it = s.upper_bound(k);
if(it != s.end())
s.erase(it);
}
cout << s.size();
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... |