結果

問題 No.3099 Parentheses Decomposition
ユーザー gew1fw
提出日時 2025-06-12 18:32:30
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 571 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 67,412 KB
最終ジャッジ日時 2025-06-12 18:32:33
合計ジャッジ時間 2,704 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 4
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

T, S, D = map(int, input().split())
travel_time = D / S
start = T
end = T + travel_time

k_min = math.ceil((start - 30) / 24)
k_max = math.floor((end - 18) / 24)

total_dangerous_time = 0.0

for k in range(k_min, k_max + 1):
    night_start = 18 + 24 * k
    night_end = 30 + 24 * k  # Represents 6 AM next day as 30 hours
    
    overlap_start = max(start, night_start)
    overlap_end = min(end, night_end)
    
    if overlap_end > overlap_start:
        total_dangerous_time += overlap_end - overlap_start

print("{0:.15f}".format(total_dangerous_time))
0