Submission #834286

#TimeUsernameProblemLanguageResultExecution timeMemory
834286HollaFoilArcade (NOI20_arcade)C++14
100 / 100
289 ms16552 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> times(m); vector<int> locations(m); vector<pair<int, int>> rotated(m); for (int i = 0; i < m; i++) cin >> times[i]; for (int i = 0; i < m; i++) cin >> locations[i]; for (int i = 0; i < m; i++) rotated[i] = make_pair(times[i]+locations[i], times[i]-locations[i]); sort(rotated.rbegin(), rotated.rend()); vector<int> antichain; for (int i = 0; i < m; i++) { auto it = lower_bound(antichain.begin(), antichain.end(), rotated[i].second); int offset = (int)(it-antichain.begin()); if (offset == antichain.size()) antichain.push_back(rotated[i].second); else antichain[offset] = rotated[i].second; } cout << antichain.size(); }

Compilation message (stderr)

Arcade.cpp: In function 'int main()':
Arcade.cpp:19:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   if (offset == antichain.size()) antichain.push_back(rotated[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...