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

暴力1A only 157ms 两点注意

Posted by Westwood at 2009-03-14 13:26:13 on Problem 2769
设求解的循环变量为i

一,i起始值是g,而不用从1开始,显然模g个数值均不同的数是不会小于g的(可以认为是鸽笼原理)
二,bool flag[]设初始false时,memset的最后一个参量应为sizeof(bool)*i,而sizeof(flag)即sizeof(bool)*1000000是多浪费时间不用说了

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