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

打表+2分可 0ms

Posted by sheeper at 2013-02-12 19:02:34 on Problem 1019 and last updated at 2013-02-12 19:04:10
一般来说能过最大的数据2147483647和样例2个,就可AC
数据2147483647对应的数在序列 s1s2……sk……中的sk处,算得k为31268。
sk=1234567891011……31268 写成sk=n1n2n3……nt……n31268,
(
  其中n1="1",n2="2",……,nt=数t对应的字符串(容易得出)
  char nt[10];
  sprintf(nt,"%d",t);
  //若t=23256 ,则nt="23256"
)
算得数据2147483647对应的数在nt处,则nt="23256"
算得数据2147483647对应的数是nt序列第a(a算得为1)个数字,即2.

算法思想就是依次二分求出k,t,再算出a,题目就迎刃而解啦。
打的表当然是数列的和函数啦。
这个方法貌似前人提过,这里换一个说法
没什么技术含量,高手勿喷。 

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