Submission #667986

#TimeUsernameProblemLanguageResultExecution timeMemory
667986bashkortLightning Rod (NOI18_lightningrod)C++17
0 / 100
1506 ms78188 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<pair<int, int>> p(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; p[i].first = a + b, p[i].second = b - a; } sort(p.begin(), p.end(), greater()); int mx = 0; int ans = 0; for (auto [x, y] : p) { if (mx < y) { mx = y; ans += 1; } } cout << ans << '\n'; return 0; }
#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...