結果

問題 No.652 E869120 and TimeZone
ユーザー ttr
提出日時 2020-02-15 21:12:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 462 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-11 12:31:51
合計ジャッジ時間 1,870 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,S = map(str, input().split())

a = int(a)
b = int(b)
c = 0
d = 0
for i in range(4, len(S)):
    if S[i] == ".":
        continue
    if 4 <= i <= 5:
        c = c*10 + int(S[i])
    else:
        d = 6*int(S[i])

if S[3] == "+":
    delta = c*60+d - 540
else:
    delta = -c*60-d -540

time = a*60+b + delta
h = (time//60)%24
m = time%60
if h < 10:
    h = "0" + str(h)
else:
    h = str(h)
if m < 10:
    m = "0" + str(m)
else:
    m = str(m)
print(h+":"+m)
0