問題一覧 > 通常問題

No.652 E869120 and TimeZone

レベル : / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 256 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 165
作問者 : e869120 / テスター : ciel
お気に入りにしたユーザー ProblemId : 1920 / 自分の提出
問題文最終更新日: 2026-10-15 21:15:04
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 184 (順位表) の他の問題:

Problem Statement

E869120 is currently in Japan. The current time is $b$ minutes past $a$ o'clock. Japan time is "UTC+9".
square1001 is currently in a certain country. The time zone of that country is $S$. S is given in the format "UTC+X" , "UTC-X", "UTC+X.X", or "UTC-X.X".
What is the local time, in hours and minutes, at the place where square1001 is?
Note that the cases include time zones that do not exist in reality.

Input

a b S

  • $0≦a≦23$
  • $0≦b≦59$
  • If $a$,$b$ have one digit, they are given with a leading 0.
  • $S$ is given in the format "UTC+X", "UTC-X", "UTC+X.X", or "UTC-X.X".
  • The time difference has at most 1 digit after the decimal point. Inputs with 2 or more digits after the decimal point are not given.
  • The time difference from $UTC$ is within $±14$.

Output

Print the local time on one line in 24-hour notation, in a format like "02:20". Do not forget the newline at the end.

Sample

Sample 1
Input
22 20 UTC+8
Output
21:20

In Beijing time, 22:20 Japan time is 21:20.

Sample 2
Input
22 20 UTC+12
Output
01:20

In Kamchatka time, 22:20 Japan time is 01:20.

Sample 3
Input
00 05 UTC+8.5
Output
23:35

In North Korea time before May 2018, 00:05 Japan time is 23:35.

Sample 4
Input
12 00 UTC-4
Output
23:00

In New York time, 12:00 Japan time is 23:00.

Sample 5
Input
09 00 UTC+11.5
Output
11:30

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。