Submission #272894

#TimeUsernameProblemLanguageResultExecution timeMemory
272894dooweyArcade (NOI20_arcade)C++14
100 / 100
222 ms16748 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int main(){ fastIO; int n, m; cin >> n >> m; int x[m], y[m]; for(int i = 0 ; i < m ; i ++ )cin >> y[i]; for(int i = 0 ; i < m ; i ++ )cin >> x[i]; vector<pii> sh; for(int i = 0 ; i < m; i ++ ){ sh.push_back(mp(x[i] + y[i], y[i] - x[i])); } sort(sh.begin(), sh.end()); vector<int> ans; int id; for(int i = m - 1; i >= 0 ; i -- ){ id = lower_bound(ans.begin(), ans.end(), sh[i].se) - ans.begin(); if(id == ans.size()) ans.push_back(sh[i].se); else ans[id] = sh[i].se; } cout << ans.size() << "\n"; return 0; }

Compilation message (stderr)

Arcade.cpp: In function 'int main()':
Arcade.cpp:29:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         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...