Submission #9585994
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll n;
cin>>n;
vector<pair<ll,ll> > pos(n);
for(ll i=0;i<n;i++)
{
ll x,y;
cin>>x>>y;
pos[i]={x,y};
}
sort(pos.begin(),pos.end());
ll last=0,ans=0;
for(ll i=1;i<n;i++)
{
if(pos[last].first+pos[last].second>pos[i].first-pos[i].second)
ans++;
else
last = i;
}
cout<<(n-ans)<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Robot Arms |
| User | lakshay |
| Language | C++14 (GCC 5.4.1) |
| Score | 0 |
| Code Size | 487 Byte |
| Status | WA |
| Exec Time | 86 ms |
| Memory | 1792 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample-01.txt, sample-02.txt, sample-03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | WA | 86 ms | 1792 KiB |
| 02.txt | WA | 78 ms | 1792 KiB |
| 03.txt | AC | 70 ms | 1792 KiB |
| 04.txt | AC | 70 ms | 1792 KiB |
| 05.txt | WA | 67 ms | 1792 KiB |
| 06.txt | WA | 64 ms | 1792 KiB |
| 07.txt | WA | 67 ms | 1792 KiB |
| 08.txt | AC | 35 ms | 1024 KiB |
| 09.txt | AC | 34 ms | 1024 KiB |
| 10.txt | WA | 42 ms | 1024 KiB |
| 11.txt | WA | 86 ms | 1792 KiB |
| 12.txt | WA | 78 ms | 1792 KiB |
| 13.txt | AC | 1 ms | 256 KiB |
| sample-01.txt | AC | 1 ms | 256 KiB |
| sample-02.txt | AC | 1 ms | 256 KiB |
| sample-03.txt | AC | 1 ms | 256 KiB |