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

How to handle P ?

Posted by pl2000t at 2006-09-04 17:31:03 on Problem 2983
I submited lots of times, but I don't know how to cut time.(my algorithm always TLE)

This is my algorithm of handle P.

I using Union-Find. And I save a distance current node with parent node.

parent node is always north position under current node.

So if two input node are same group, I check their distance is right or wrong.

Otherwise I connect them and settle their distance.

the rest is up to bellman-ford algorithm.

this is my algorithm. so please teach me how to do get ACC not TLE.

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