結果
| 問題 | No.652 E869120 and TimeZone |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-08 18:23:02 |
| 言語 | Lua (LuaJit 2.1.1767980792) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 441 bytes |
| 記録 | |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 8,356 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-01-29 13:09:30 |
| 合計ジャッジ時間 | 1,112 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 31 |
ソースコード
s = io.read()
hour, min, pm, utc = string.match(s, "(%d+) (%d+) UTC([%+%-])([%.%d]+)")
hour, min = tonumber(hour), tonumber(min)
utc_h, utc_m = string.match(utc, "(%d+)%.?(%d?)")
if(utc_m == "") then utc_m = "0" end
utc_h, utc_m = tonumber(utc_h), tonumber(utc_m)
if(pm == "-") then utc_h, utc_m = -utc_h, -utc_m end
v = (hour + utc_h - 9) * 60 + utc_m * 6 + min
v = v % 1440
print(string.format("%02d:%02d", math.floor(v / 60), v % 60))