pata1052
750 ワード
#include
#include
#include
#include
using namespace std;
const int maxn=100010;
struct node{
int add,next,data;
bool flag;
}_node[maxn];
bool cmp(node a,node b){
return a.data>n>>begin;
for(int i=0;i>_add>>_data>>_next;
_node[_add].add=_add;
_node[_add].data=_data;
_node[_add].next=_next;
}
int p=begin;
int count=0;
vector vn;
while(p!=-1){
_node[p].flag=true;
vn.push_back(_node[p]);
count++;
p=_node[p].next;
}
if(count==0){
cout<<0<