# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1188622 | krittaphot | Rabbit Carrot (LMIO19_triusis) | Pypy 3 | 135 ms | 48800 KiB |
def min_modifications(n, m, heights):
current_height = 0
changes = 0
for h in heights:
if h - current_height > m:
# ต้องลดเสานี้ลงมาให้อยู่ในระยะกระโดด
changes += 1
current_height = current_height + m
else:
# ไม่ต้องแก้ เพราะกระโดดถึง (ขึ้นไม่เกิน M หรือ ลง)
current_height = h
return changes
Compilation message (stdout)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |