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 |
Re:一开始就像到分区间,可是被unsigned long害死了In Reply To:一开始就像到分区间,可是被unsigned long害死了 Posted by:smallport at 2009-04-10 02:55:43 > 程序跑起来0MS,因为一开始要分区间,分成 [1,9](该区间总共45个数字),[....10,......99],(该区间总共9000个数字)[.....100,.....999](该区间总共1386450个数字) ... 这样子分,然后不断把i缩小到最后某个区间内。算法一来就想到了,可是一个晚上都有个错,就是要用long long才行,如果用unsigned long,会超过表示范围。并且,用GCC的注意了,如果你用GCC,long long也是错的,要用C才行。最不喜欢这种变量范围的题,和那道青蛙约会一样,首先变量的类型要确定,然后用GCC就是错,要用C才Accepted. > 气啊~ 感谢啊~原来是这个原因过不了~~也气啊!! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator