Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
帮忙看看我这个想法对不对啊总共有三种动物,定义same[](并查集操作)表示x,y是否为同一类,eat[i]表示i能够吃得动物的集合,eaten[i]表示能够吃i的集合,根据输入按照d=1 x y合并x,y ;eat[x], eat[y]; eaten[x], eaten[y];按照d=2 x y合并eat[x],y; x, eaten[y];eaten[x], eat[y]如此下去,每次先判断是否与以前的话冲突。 请问这个想法有没有问题啊,总是wa。thanks! Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator