Submission #284856

#TimeUsernameProblemLanguageResultExecution timeMemory
2848563zpArcade (NOI20_arcade)C++14
100 / 100
982 ms18012 KiB
#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)

Arcade.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      |      ^
Arcade.cpp: In function 'int main()':
Arcade.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i = 0; i < V.size(); i++){
      |                    ~~^~~~~~~~~~
#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...