# | 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 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
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.