結果
| 問題 | No.652 E869120 and TimeZone | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-12-29 19:52:32 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 35 ms / 1,000 ms | 
| コード長 | 561 bytes | 
| コンパイル時間 | 246 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-12-29 19:52:35 | 
| 合計ジャッジ時間 | 2,919 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 30 | 
ソースコード
import math
a, b, s = input().split()
a = int(a)
b = int(b)
utc = a * 60 + b - 540
diff = "".join(filter(lambda x:x.isdigit() or x == ".", s))
diff = float(diff)
s = list(s)
res = 0
if s[3] == "+":
    d = round(diff * 60, 3)
    res = utc + math.ceil(d)
elif s[3] == "-":
    d = round(diff * 60 * (-1), 3)
    res = utc + math.ceil(d)
if res == 0:
    print("00:00")
    exit()
if res >= 1440:
    h = res // 60 - 24
    m = res % 60
elif res <= 0:
    h = res // 60 + 24
    m = res % 60
else:
    h = res // 60
    m = res % 60
print(f'{h:0=2}:{m:0=2}')
            
            
            
        