Submission #256665

# Submission time Handle Problem Language Result Execution time Memory
256665 2020-08-03T06:06:46 Z tes Arcade (NOI20_arcade) C++14
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    long long n,m;
    cin>>n>>m;
    long long t[m+5],a[m+5];
    for(long long i=0;i<m;i++) cin>>t[i];
    for(long long i=0;i<m;i++) cin>>a[i];
    vector<pair<long long,long long>> v;
    for(long long i=0;i<m;i++) v.push_back({t[i]+a[i],t[i]-a[i]});
    sort(v.begin(),v.end(),[](pair<long long,long long> a,pair<long long,long long> b){
        if(a.first==b.first) return a.second>b.second;
        return a.first<b.first;
    });
    vector<long long> w;
    for(long long i=0;i<m;i++){
        long long pos=lower_bound(w.begin(),w.end(),v[i].second)-w.begin();
        if(pos==w.size()) w.push_back(v[i].second);
        else w[pos]=v[i].second;
    }
    cout<<w.size()<<endl;
}

Compilation message

Arcade.cpp: In function 'int main()':
Arcade.cpp:20:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(pos==w.size()) w.push_back(v[i].second);
            ~~~^~~~~~~~~~
# 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 -