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 1321. Floor Indicator

WA:9
Posted by SPbETU#1 15 Apr 2004 17:02
Who can helpme with some hint about this problem?

Any right answers, any tests...

I've got WA:9, and I can't find mistake
Re: WA:9
Posted by breeze 18 Apr 2004 19:26
5->4
6->4
7->4
8->4
9->4
10->8
11->8
12~19->6
20~39->11
40->99->31
100~119->71
120~199->51
200~399->101
400~999->301
and so on......i use this rule and got AC.
maybe it is a bad methodology......

Edited by author 18.04.2004 19:35
Re: WA:9
Posted by HybridTheory 3 Nov 2004 21:09
Why the answer is 4 when n is from 5 to 9?
Re: WA:9
Posted by Pio (Pio@mail.by) 5 Mar 2006 14:10
to breeze: thanks... you tests very helped me...
Re: WA:9
Posted by Zeva [USU] 7 May 2006 21:00
But if input:
1000 - 701?
1100 - 701?
1200 - 501?
1300 - 501?
2000 - 1001?
4000 - 3001?
I have WA#11
Re: WA:9
Posted by yuhch 25 Oct 2007 17:57
[deleted]

Edited by author 25.10.2007 17:59
Re: WA:9
Posted by yuhch 25 Oct 2007 17:57
why the answer to n=40 is 31?
Re: WA:9
Posted by Denis Koshman 12 Aug 2008 03:39
Because range 1..5 has each lamp in ON and OFF states, and it appears to be the smallest range for all 5<=N<=9

My solution is checking all A..B ranges for the 1st digit. If B-A>1, then I set it as A999999999 till B00000000. If B-A=1, then I try all ranges for the 2nd digit. It appears that no more recursion is necessary, so the answer will be minimal among all BD000000... - AC9999... where A..B covers all lamp states for the 1st digit (consider their existence too and treat zero as all-off) and 0..C together with D..9 covers all lamp states for the 2nd digit.