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

二分比较快

Posted by MarHong at 2010-04-08 19:25:28 on Problem 2739
In Reply To:此题具有单调性~,可线性枚举。 Posted by:lvcheng at 2010-04-08 18:34:06
> 把素数表筛出来,然后二重循环头尾即可,有一个优化,注意到具有单调性,因此,枚举尾,维护头指针,可以做到线性求解,不过由于数据弱,好像两个都是0ms,呵呵~。

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