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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
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.