답안 #667982

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
667982 2022-12-02T13:27:45 Z bashkort Lightning Rod (NOI18_lightningrod) C++17
14 / 100
1990 ms 226928 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<int> x(n), y(n);
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        x[i] = a - b, y[i] = a + b;
    }

    vector<int> ord(n);
    iota(ord.begin(), ord.end(), 0);
    sort(ord.begin(), ord.end(), [&](int i, int j) {
        return pair{x[i], -y[i]} < pair{x[j], -y[j]};
    });

    int mx = 0;
    int ans = 0;
    for (int i : ord) {
        if (mx < y[i]) {
            mx = y[i];
            ans += 1;
        }
    }

    cout << ans << '\n';

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1680 ms 226928 KB Output is correct
2 Correct 1802 ms 226332 KB Output is correct
3 Correct 1826 ms 220212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1837 ms 213684 KB Output is correct
2 Correct 1990 ms 213412 KB Output is correct
3 Correct 1762 ms 208360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1680 ms 226928 KB Output is correct
2 Correct 1802 ms 226332 KB Output is correct
3 Correct 1826 ms 220212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Halted 0 ms 0 KB -