Reducing Run Time

Правка en2, от love_you_ma, 2015-08-08 04:26:30

** Hi. A few days ago I have solved a Problem on UVa named Virtual Friends . The link is here : Click Here This is a Union Find / Disjoint Set Find problem . I used that algorithm and Got Accepted verdict at 2.281 Sec. Although the problem says it's Time Limit is 10 Sec. May be the data set is Huge. I have seen the Best Submission ever for this problem is 0.104 Sec.

Now my Question is how to decrease my Run Time?? I want to get Accepted verdict less than 1 Sec. How to optimize my Code ??

My Code is : http://ideone.com/34YqH9

Thanks is Advance. **

Теги uva 11503, less run time

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский love_you_ma 2015-08-08 04:30:21 13
en2 Английский love_you_ma 2015-08-08 04:26:30 5 Bold Tag Added.
en1 Английский love_you_ma 2015-08-08 04:25:28 635 Initial revision (published)