結果

問題 No.1236 長針と短針
ユーザー lam6er
提出日時 2025-03-31 17:39:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 512 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 54,060 KB
最終ジャッジ日時 2025-03-31 17:40:40
合計ジャッジ時間 1,752 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

# Calculate the angles of the hour and minute hands
hour_angle = (A % 12) * 30 + B * 0.5
minute_angle = B * 6

# Compute the angle difference modulo 360 to get the smallest positive difference
delta = (hour_angle - minute_angle) % 360

# Check if the hands are already aligned
if abs(delta) < 1e-9:
    print(0)
else:
    # Calculate the required time in minutes and convert to seconds
    t_minutes = delta / 5.5
    total_seconds = t_minutes * 60
    print(int(total_seconds))
0