In this submission is there any logical error or precision error? I have been trying to tackle this issue for over an hour and still couldn't figure out the issue. The logic is not very complicated.
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
In this submission is there any logical error or precision error? I have been trying to tackle this issue for over an hour and still couldn't figure out the issue. The logic is not very complicated.
Name |
---|
Just some little comments
1) search for fast I/O a sample here and you may encounter TLE for this question
2) try not to use float/double unless you really need it. For this question you need double when print the answer only, but not necessary in storing the values
the sample i/o is using only 6 precision digits why are you using 17? see your first input the 4th line gives 1.33333333333333326 instead of 6 3's. I think this your main issue. the 10th test also says that thing- "wrong answer 103364th numbers differ — expected: '-1307.3528710', found: '-1307.3548723', error = '0.0000015'"
use vectors instead of stack, it seems you are using too much memory
Not the case. As long as the difference of the answer and the output does not exceed 10^-6, it's fine, no matter how many digits there are. Here, the difference is 0.002, so if it prints only 6 digits or 8 digits, it will still be 0.002.
There has been no MLE test cases yet. Also, I don't think there will be much difference between std::vector and std::stack.
Maybe it could work fine. But, I recommend declaring the arrays globally all the time.
It's not a good practice for programming for work. Otherwise, I don't see much difference between declaring bits/stdc++.h and a bunch of other headers, performance wise, just a few extra seconds of compiling (the compiler will know what the code needs, so it won't include unnecessary things in the actual program).
You can use precompiled headers to get rid of those extra seconds.
I do not understand your logic exactly but you do some strange things with this
plus
variable. For example, I wrote the following test case:The last output is 2.5, which doesn't seem to be the average of 10 and 5.