結果

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

ソースコード

diff #

T, S, D = map(int, input().split())
t_total = D / S
S_time = T
E_time = T + t_total

total_careful = 0.0

max_k = int((E_time - 18) // 24) + 2  # Adding 2 to ensure we cover all possible k

for k in range(max_k + 1):
    night_start = 18 + 24 * k
    night_end = 30 + 24 * k  # 6 + 24*(k+1) = 6 + 24k +24 = 30 +24k
    
    if E_time <= night_start:
        continue
    if S_time >= night_end:
        continue
    
    overlap_start = max(S_time, night_start)
    overlap_end = min(E_time, night_end)
    
    if overlap_start < overlap_end:
        total_careful += overlap_end - overlap_start

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