Submission #256665

#TimeUsernameProblemLanguageResultExecution timeMemory
256665tesArcade (NOI20_arcade)C++14
0 / 100
1 ms384 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...