問題一覧 > 通常問題

No.1236 Long Hand and Short Hand

レベル : / AI推定難易度 : 600 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 260
作問者 : 👑 qand / テスター : PCT PCTprobability
お気に入りにしたユーザー ProblemId : 4941 / 自分の提出
問題文最終更新日: 2021-05-11 15:19:33
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 267 (順位表) の他の問題:

Problem Statement

There is an ordinary analog clock. The current time is $A$ hours $B$ minutes $0$ seconds. Find the minimum number of seconds from now until the minute hand and the hour hand of this clock are at the same position. Round down any fractional part.

Input

$A\ B$

  • All inputs are integers.
  • $0 \le A < 24$
  • $0 \le B < 60$
  • The input is given with leading zeros so that both of $A,B$ have $2$ digits.

Output

Output the minimum number of seconds until the minute hand and the hour hand overlap, rounding down any fractional part. Also, print a newline at the end.

Sample

Sample 1
Input
11 59
Output
60

The hands overlap exactly 1 minute later. Since 1 minute is 60 seconds, output 60.

Sample 2
Input
12 34
Output
1887

Round down any fractional part.

Sample 3
Input
12 00
Output
0

The hands overlap exactly right now.

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