Repository navigation
Conversation
added 7 commits
September 20, 2026 23:34
EvgrafovMichail
left a comment
Member
There was a problem hiding this comment.
Итог за тесты: 9.6
Итоговый штраф: 1.25
Итог с учетом округления: 8
| elif sequence_id < 0 or sequence_id > SEQUENCE_ID_MAX: | ||
| print("sequence_id must be in [0; 4095]") | ||
| return None | ||
| elif decode_timestamp_ms(epoch_ms) > TIMESTAMP_MS_MAX: |
Member
There was a problem hiding this comment.
Что значит этот вызов? Вы на вход функции, которая работает со snowflake_id передаете timestamp. В итоге рассчитанное значение некорректное, и проверка некорректна. Часто тестов на этом не проходит.
| if node_id < 0 or node_id > NODE_ID_MAX: | ||
| print("node_id must be in range[0; 1023]") | ||
| return None | ||
| elif sequence_id < 0 or sequence_id > SEQUENCE_ID_MAX: |
Member
There was a problem hiding this comment.
Здесь не нужен elif и else. Это нарушение критерия T1. Минус 0.25 балла
| return None | ||
|
|
||
| return ( | ||
| read_current_millis(epoch_ms) << (NODE_ID_BITS + SEQUENCE_ID_BITS) |
Member
There was a problem hiding this comment.
Расчет сдвига дублируется. Нарушение критерия S1. Минус балл
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.