3450. Fast Width - #include <Seter> - using namespace Orz;

3450. Fast Width

Seter posted @ 2011年8月05日 15:14 in SPOJ with tags Partial DisjointSet , 1396 阅读

http://www.spoj.pl/problems/FASTW/

ID DATE USER PROBLEM RESULT TIME MEM LANG
5471365 2011-08-05 09:09:17 Seter Fast Width 100 
edit  run
0.26 3.2M

C

在fotile犇的blog(TimeOut...)里看到推荐这题(Orz)。。就去做了下。有点小水啊,就是按W排序后从大到小UNION相应的IJ然后看1与N是否SAME。第一次交的时候按秩合并写错了(今天改的时候才发现!晕!没更新size),BUT加快排还是0.6S水过,但总觉得不够快。看看W<65000于是改了个桶排果然快了不少(应该不能更快了罢)!

By Seter
  • 无匹配

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee