ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1209. 1, 10, 100, 1000...

an idea
Posted by HuaLee 28 Oct 2010 18:15
假设第n个1的位置在a(n);a(1)=1,a(n+1)=a(n)+n;所以we get a(n)=n*(n-1)/2+1;所以if you input number k.when k==1 or 2,得到1;else 令n=int(sqrt(2.0*k))+1,if a(n)==k,得到1,否则得到0.
Re: an idea
Posted by Jason 28 Jan 2011 04:18
Spoiler alert!!!
Re: an idea
Posted by zxy_snow 27 May 2011 08:51
Bright idea~