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 szxyj at 2011-04-08 21:21:37 on Problem 1047
设该数为N=a1a2a3a4……an
比较明显的两个必要条件
(1)式 N*(n+1)=999……999(n个9)
(2)式 N*(1+2+3+……+n)=(a1+a2+……+an)*111……111(n个9)

(2)式可以排除33 11111111这些伪解 (没有完全测试过...不知道会不会还是有错解...)

看到有个程序里写的是 (a1+a2+……+an)*2=9n (3)式
把(1)式和(2)式相除
n*(n+1)/2          999……999 
--------- = -----------------------
  (n+1)     (a1+a2+……+an)*111……111 
即
n/2=9/(a1+a2+……+an)
即
(a1+a2+……+an)*2=9n

因此可以利用(1)(3)式快速判断

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