| ||||||||||
| 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:Time Limit Exceeded 怎么该啊!算法不会,大侠指点啊!In Reply To:Time Limit Exceeded 怎么该啊!算法不会,大侠指点啊! Posted by:wzdhlj2 at 2011-12-06 23:20:10 ax = b%n
我刚尝试了下,如果不没有这段代码,1000组数据耗时3951,用了耗时134
long tmp = extgcd(a, b);
if(tmp >1)
{
a= a/tmp;
b= b/tmp;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator