Official
A - 時計/Clock Editorial
by
A - 時計/Clock Editorial
by
sounansya
\(X\) の値で場合分けすることを考えます。
本当の時刻は、\(X \le 0\) のときは 12 時 \(|X|\) 分、\(X > 0\) のときは 11 時 \(X\) 分です。
実装例は以下のようになります。出力のフォーマットに注意してください。
実装例 (Python3)
X = int(input())
if X <= 0:
if -X < 10:
print("12:0" + str(-X))
else:
print("12:" + str(-X))
else:
print("11:" + str(60 - X))
posted:
last update:
