HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Forums > Discussion of problems > topic:


Problem "Two and chtototams"

Âëàäèñëàâ ÎðëîâOct.11.2024 at 04:55:01 PM
0x = ôîìà y = Åð¸ìà
êîä âîò:
n = int(input())
k = int(input())
y = (n-k)//2
res = 0
for y1 in range(y, n-1):
if n - y1 != n and n - y1 != 0:
res += 1
print(res)
íî ìíå îí âûäà¸ò îøèáêó íà òåñòå 1
ÿ ðàññóæäàë òàê X + Y = N
=>X = N - Y
X >= Y + K
N - y >= y + k => Y = (N - k)//2


www.contester.ru