Hi, I was trying to solve 352C - Jeff and Rounding. My solution is 6873811. It's giving output as '0.000' in CF, even in Ideone.com, But in CodeBlocks IDE, it's giving correct answer '0.250'. Please help. What is the problem?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Hi, I was trying to solve 352C - Jeff and Rounding. My solution is 6873811. It's giving output as '0.000' in CF, even in Ideone.com, But in CodeBlocks IDE, it's giving correct answer '0.250'. Please help. What is the problem?
Name |
---|
You are using both iostream and cstdio to handle input and output, remove line with
ios::sync_with_stdio(0);
and everything should be ok (I tried this on ideone.com and it wrote 0.250).By the way you shouldn't call a function inside Abs, because for example Abs(solve(n+1,f+1) + ar[n]) will be translated to ((solve(n+1,f+1) + ar[n]) > 0? solve(n+1,f+1) + ar[n] : -(solve(n+1,f+1) + ar[n])) so function solve will be called twice, just saying, sometimes it can increase complexity a lot.
Thanks a lot! :-)