# | 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 | 170 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
5 | -is-this-fft- | 158 |
7 | adamant | 154 |
7 | Dominater069 | 154 |
9 | awoo | 153 |
10 | luogu_official | 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.