Даулетбек Досай 404 группа (КФ) RaceTesting 10965
Арсен Жуматай,304 RaceTesting 12787
f1from itertools import cycle, islicef1from itertools import cycle, islice
22
n3def speed(distances, checkpoints, durations):n3def speed(path, stops, times):
4    checkpoint_cycle = cycle(checkpoints)4    stops_cycle = cycle(stops)
5    distance_iter = iter(distances)5    path_iter = iter(path)
6    duration_iter = iter(durations)6    time_iter = iter(times)
7    while True:7    while True:
n8        checkpoint_count = next(checkpoint_cycle)n8        stop_count = next(stops_cycle)
9        segment_distance = sum(islice(distance_iter, checkpoint_count))9        distance = sum(islice(path_iter, stop_count))
10        if segment_distance == 0:10        if distance == 0:
11            break11            break
t12        time_taken = next(duration_iter)t12        time_spent = next(time_iter)
13        yield (segment_distance / time_taken)13        yield (distance / time_spent)
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op