Submission #743093

# Submission time Handle Problem Language Result Execution time Memory
743093 2023-05-17T07:53:28 Z vjudge1 Lightning Rod (NOI18_lightningrod) C++17
0 / 100
2000 ms 197400 KB
#include<bits/stdc++.h>
using namespace std;

#define iii tuple<int,int,int>
int n;

struct top
{
    int x,y,sta;
};
inline void read(int &x)
{
    x = 0;
    char ch = getchar_unlocked();
    while (ch & 16)
    {
        x = (x << 3) + (x << 1) + (ch & 15);
        ch = getchar_unlocked();
    }
}
vector<top> top;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    read(n);
    for(int i=1;i<=n;++i)
    {
        int x,y;
        cin >> x >> y;
        top.push_back({x,y,1});
    }
    for(int i=0;i<n;++i)
    {
        for(int j=0;j<n;++j)
        {
            if(i == j) continue;
            if(abs(top[i].x-top[j].x) <= top[i].y-top[j].y)
            {
                top[j].sta = 0;
            }
        }
    }
    int cnt = 0;
    for(int i=0;i<n;++i)
    {
        if(top[i].sta == 1) ++cnt;
    }
    cout << cnt;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2070 ms 197400 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2051 ms 197376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2070 ms 197400 KB Time limit exceeded
2 Halted 0 ms 0 KB -