Submission #285105

# Submission time Handle Problem Language Result Execution time Memory
285105 2020-08-28T10:19:11 Z achibasadzishvili Arcade (NOI20_arcade) C++14
0 / 100
1 ms 384 KB
#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

Arcade.cpp: In function 'int main()':
Arcade.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for(int i=0; i<v.size(); i++){
      |                  ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -