답안 #743092

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
743092 2023-05-17T07:52:59 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
40 / 100
2000 ms 96820 KB
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
const int N = 1e7 + 1;
pair<int,int> arr[N];
map<pair<int,int>, bool> mp;
bool comp(const pair<int,int> &a, const pair<int,int> &b) {
    if (a.second != b.second) return a.second > b.second;
    return a.first > b.first;
}
inline void read(int &x)
{
    x = 0;
    char ch = getchar_unlocked();
    while (ch & 16)
    {
        x = (x << 3) + (x << 1) + (ch & 15);
        ch = getchar_unlocked();
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int n,ans=0; read(n);
    for(int i=1;i<=n;i++) {
        read(arr[i].x);
        read(arr[i].y);
    }
    sort(arr+1, arr+1+n, comp);
    for(int i=1;i<=n;i++) {
        bool check = false;
        for(auto [a,b]:mp) {
            if (abs(arr[i].x - a.x) <= abs(arr[i].y - a.y)) check = true;
        }
        if (!check) {
            ans++;
            mp[arr[i]] = true;
        }
    }
    cout << ans;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2077 ms 96820 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 21 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 7 ms 376 KB Output is correct
13 Correct 21 ms 340 KB Output is correct
14 Correct 438 ms 1776 KB Output is correct
15 Correct 715 ms 1856 KB Output is correct
16 Execution timed out 2053 ms 2788 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2020 ms 82232 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2077 ms 96820 KB Time limit exceeded
2 Halted 0 ms 0 KB -