10953 - Stochastic Digit Generator
Moderator: Board moderators
10953 - Stochastic Digit Generator
During the contest i spend 4 hours with this problem. I had a little error in the mod calculating part, but the funny thing is, that after i corrected, i still got WA. My last minute attemp was to change all the variables from long double to double. Curiously, i got accepted. Afterwards i checked if you just had to change the variables, and in the OJ i got WA with long double again when my code with double got AC. Should there be a little rejudging? I think it is unfair, since my results should theoretically be more precise!
If anyone wants my code, i can submit it via email
If anyone wants my code, i can submit it via email
Impossible is nothing
Maybe I want to ur code,can you send it to zhangfan555@tom.com.
Thanks.
Thanks.
If anyone wants my code, i can submit it via email
-
- System administrator & Problemsetter
- Posts: 399
- Joined: Sat Jan 12, 2002 2:00 am
hmm
This problem had a special judge but may be it was not used by mistake.
-
- Guru
- Posts: 647
- Joined: Wed Jun 26, 2002 10:12 pm
- Location: Hong Kong and New York City
- Contact:
I thought this was trivial DP, but maybe my precision is off somewhere.. I've tried double and long double but neither worked.. does anyone have any test cases? =)
Check out http://www.algorithmist.com !
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
This problem is easy, but it's also easy to make some silly mistakes (it took me over 30 minutes to figure all signs out, like when to add and when to subtract). I have AC with doubles, but not with long doubles. Some small cases:
Output:
Code: Select all
10
0 0.1
1 0.9
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
9
* 0
* 1
*0 10
*0 0
*4 7
*1 0
*** 1
*** 0
************************************************** 0
0
Code: Select all
Case 1:
0.10000000
0.90000000
0.90000000
0.10000000
0.00000000
0.90000000
0.74700000
0.16300000
0.19087903
-
- Guru
- Posts: 584
- Joined: Thu Jun 19, 2003 3:48 am
- Location: Sanok, Poland
- Contact:
-
- Guru
- Posts: 647
- Joined: Wed Jun 26, 2002 10:12 pm
- Location: Hong Kong and New York City
- Contact:
Well, you can use the other way of checking of a number is divisible by 11... though you can easily just DP the other way.
In any case, my output matches yours.. so maybe it's a harder case somewhere.. =/
In any case, my output matches yours.. so maybe it's a harder case somewhere.. =/
Check out http://www.algorithmist.com !
-
- Guru
- Posts: 647
- Joined: Wed Jun 26, 2002 10:12 pm
- Location: Hong Kong and New York City
- Contact:
Nevermind, I've been making tons of silly mistakes lately.. if anyone's curious, my mistake was I had a < instead of <= in a loop somewhere.. sigh.
Check out http://www.algorithmist.com !