답안 #667986

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1409 ms 76096 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1506 ms 78188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1409 ms 76096 KB Output isn't correct
2 Halted 0 ms 0 KB -