№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
Название |
---|
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.