#include #include using namespace std; int n; bool ce[100001]={0}; struct link{ int x,y; }a[100001]; bool pan(link yi,link er){ return yi.x>n; for(int i=0;i>a[i].x>>a[i].y; } sort(a,a+n,pan); /* for (int i = 0; i =a[i].y){ ce[i]=1; //cout<=0;i--){ if(a[now].y-(a[now].x-a[i].x)>=a[i].y){ ce[i]=1; //cout<