Submission #834288

#TimeUsernameProblemLanguageResultExecution timeMemory
834288LiudasArcade (NOI20_arcade)C++17
0 / 100
0 ms212 KiB
#include <vector> #include <iostream> #include <set> #include <algorithm> using namespace std; int main(){ int N, M; cin >> N >> M; vector<pair<int, int>> arr(M); for(int i = 0; i < M; i ++){ cin >> arr[i].first; } for(int i = 0; i < M; i ++){ cin >> arr[i].second; } for(int i = 0; i < M; i ++){ arr[i] = {arr[i].first + arr[i].second, arr[i].first - arr[i].second}; } sort(arr.rbegin(), arr.rend()); vector<pair<int, int>> ans; for(int i = 0; i < M; i ++){ int id = lower_bound(ans.begin(), ans.end(), arr[i])-ans.begin(); if(id != ans.size()){ ans[id] = arr[i]; } else{ ans.push_back(arr[i]); } } cout << ans.size() << endl; return 0; }

Compilation message (stderr)

Arcade.cpp: In function 'int main()':
Arcade.cpp:23:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         if(id != ans.size()){
      |            ~~~^~~~~~~~~~~~~
#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...