# | User | Rating |
---|---|---|
1 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 158 |
5 | atcoder_official | 157 |
6 | Qingyu | 155 |
7 | djm03178 | 151 |
7 | adamant | 151 |
9 | luogu_official | 150 |
10 | awoo | 147 |
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.