| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357544 | baosonnguyenthe20 | Lightning Rod (NOI18_lightningrod) | C++20 | 72 ms | 16000 KiB |
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define N int(1e6)
using namespace std;
ll n, ans;
pair<ll, ll>vt[N+10];
bool ok[N+10];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
for(int i=1; i<=n; i++) cin>>vt[i].fi>>vt[i].se;
vt[0].fi=vt[0].se=0;
if(n<=2000)
{
sort(vt+1, vt+n+1);
for(int i=1; i<=n; i++)
{
if(!ok[i])
{
//cout<<i<<" "<<vt[i].fi<<" "<<vt[i].se<<" ";
for(int j=0; j<=n; j++)
{
if(i==j) continue;
if(abs(vt[i].fi-vt[j].fi)<=(vt[i].se-vt[j].se))
{//cout<<j<<" "<<vt[j].fi<<" "<<vt[j].se<<" ";
// cout<<j<<" ";
ok[j]=1;
}
}
//cout<<'\n';
}
}
for(int i=1; i<=n; i++) if(!ok[i]) ans++;
cout<<ans;
}
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
