結果

問題 No.652 E869120 and TimeZone
ユーザー lam6er
提出日時 2025-03-31 17:31:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 1,000 ms
コード長 711 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 53,400 KB
最終ジャッジ日時 2025-03-31 17:33:03
合計ジャッジ時間 2,711 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, s = input().split()
a = int(a)
b = int(b)

japan_time_minutes = a * 60 + b
utc_minutes = (japan_time_minutes - 540) % 1440  # 540 minutes = 9 hours

# Parse the timezone offset
sign = s[3]
num_str = s[4:]

if '.' in num_str:
    integer_part_str, fractional_str = num_str.split('.', 1)
else:
    integer_part_str = num_str
    fractional_str = '0'

integer_part = int(integer_part_str)
fractional_digit = int(fractional_str) if fractional_str else 0

offset_minutes = integer_part * 60 + fractional_digit * 6

if sign == '-':
    offset_minutes = -offset_minutes

local_total = (utc_minutes + offset_minutes) % 1440
hours = local_total // 60
minutes = local_total % 60

print(f"{hours:02d}:{minutes:02d}")
0