# | 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 |
Name |
---|
code: https://paste.ubuntu.com/25515182/
Why wouldn't lessThan be a < b + eps and lessThanEqual be a <= b + eps?
In your code (and in code in the post) there are a lot of constructions like this:
Do you know that they should be written like this:?
And what's wrong? It's more readable than
return A == B
It's code with excess branching, it can't be more readable. When you use if-else, it means that you have some different behaviour based on the condition. But when you need just return result of condition, like in these cases with a simple comparison, you should write as it is:
return condition;
.It's really a basic and famous example of how you can make your code dirtier with such return true/false and I don`t understand how you can say that it is more readable.
It's really a basic and famous example how to write beautiful and readable code:
I bet you will write
return very_long_condition_1 || very_long_condition_2
and someone will refactor it eventually.At first,
A == B
is not a very_long_condition.At second, I will not.
The post and code from the comment have only single-comparison conditions. So it's a very bad attempt from you to try say that I can't balance between shortness and readability in that way =)
I always like Sarcasm public.