Submission #743053

# Submission time Handle Problem Language Result Execution time Memory
743053 2023-05-17T07:39:51 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
40 / 100
2000 ms 78288 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;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int n,ans=0; cin >> n;
    for(int i=1;i<=n;i++) cin >> arr[i].x >> 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;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2080 ms 76488 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 268 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 268 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 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 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 268 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 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 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Correct 16 ms 396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 268 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 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 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 5 ms 340 KB Output is correct
13 Correct 16 ms 396 KB Output is correct
14 Correct 376 ms 1896 KB Output is correct
15 Correct 571 ms 3400 KB Output is correct
16 Execution timed out 2035 ms 4384 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2088 ms 78288 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2080 ms 76488 KB Time limit exceeded
2 Halted 0 ms 0 KB -