Initial course version#1
Conversation
Konstantin Chaika (kochaika)
left a comment
There was a problem hiding this comment.
Perhaps these comments apply to other tasks as well.
Roman Kovalev (@KovalevRoma) pay attention to it too
| @@ -0,0 +1,33 @@ | |||
| def points_cover_naive(starts, ends, points): | |||
There was a problem hiding this comment.
from bisect import bisect_left, bisect_right
from sys import stdin
Imports are missing
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| data = list(map(int, stdin.read().split())) |
There was a problem hiding this comment.
Am I correct in understanding that stdin.read() will keep reading as long as there is data to read, and if I run this in an IDE (click run button) and enter data manually, the input will never finish?
| @@ -0,0 +1,44 @@ | |||
| def partition3_naive(values): | |||
| for c in product(range(3), repeat=len(values)): | |||
There was a problem hiding this comment.
NameError: name 'product' is not defined
There was a problem hiding this comment.
Traceback (most recent call last):
File "/Users/Konstantin.Chaika/PycharmProjects/algorithmic-toolbox-python/L03/T04/tests/tests.py", line 12, in test_random_pairs
self.assertEqual(a * b // math.gcd(a, b), lcm(a, b), msg=f"Wrong answer for a={a}, b={b}")
^^^^^^^^^
File "/Users/Konstantin.Chaika/PycharmProjects/algorithmic-toolbox-python/L03/T04/lcm.py", line 12, in lcm
assert 1 <= a <= 2 * 10 ** 9 and 1 <= b <= 2 * 10 ** 9
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
There was a problem hiding this comment.
Maybe assert inside the lcm function is not a thing we should use here
Or at least do not call it from tests with invalid inputs
|
|
||
| After entering the input, send EOF: | ||
| - `Ctrl + Z`, then `Enter` for **Windows** | ||
| - `Ctrl + D` for **macOS** or **Linux** |
There was a problem hiding this comment.
Ctrl + D does not work on MacOS when app is run inside the IDE. With green triangle button click
But it do work in the terminal
When app is run inside the IDE Cmd + D works...
¯\_(ツ)_/¯
| vendor: | ||
| name: JetBrains | ||
| email: support@jetbrains.com | ||
| url: https://www.jetbrains.com/ |
There was a problem hiding this comment.
Need to be removed: Sasha will publish it from his own vendor!




This PR contains a first complete version of the course with a brief introduction.