Submission #667986

# Submission time Handle Problem Language Result Execution time Memory
667986 2022-12-02T13:32:51 Z bashkort Lightning Rod (NOI18_lightningrod) C++17
0 / 100
1506 ms 78188 KB
#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 time Memory Grader output
1 Incorrect 1409 ms 76096 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1506 ms 78188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1409 ms 76096 KB Output isn't correct
2 Halted 0 ms 0 KB -