Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:总结此题可以精简到一个并查集!并且用向量的思考模式想整个过程相当简单!

Posted by flatfish at 2009-05-27 15:09:49 on Problem 1182
In Reply To:总结此题可以精简到一个并查集!并且用向量的思考模式想整个过程相当简单! Posted by:majiaN at 2008-10-19 10:58:32
ch[k]=(ch[k]+ch[p[k]])%3; //这个向量关系需要发现
if ((ch[x]-ch[y]+3)%3!=d)//这个关系根据上面的可以自己用向量推
ch[tp]=(ch[y]-ch[x]+d+6)%3;//这个同理 

怎么得到或验证上述关系?

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator