結果

問題 No.1236 長針と短針
ユーザー hal9009hal9009
提出日時 2020-11-14 17:48:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 917 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 7,996 KB
最終ジャッジ日時 2023-09-30 05:14:38
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,844 KB
testcase_01 AC 20 ms
7,972 KB
testcase_02 AC 19 ms
7,960 KB
testcase_03 AC 19 ms
7,848 KB
testcase_04 AC 19 ms
7,944 KB
testcase_05 AC 19 ms
7,852 KB
testcase_06 WA -
testcase_07 AC 19 ms
7,828 KB
testcase_08 AC 19 ms
7,800 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 20 ms
7,940 KB
testcase_12 WA -
testcase_13 AC 19 ms
7,784 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 18 ms
7,984 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int,input().split())
sec = (a * 60 + b) * 60

aCalc = sec / 3600
bCalc = (sec % 3600) / 60

positionA = aCalc / 12 * 100
positionB = bCalc / 60 * 100



minimum = 9999
minimumS = -1
for i in range(3900):
    aCalc = (sec + i)  / 3600
    bCalc = ((sec + i) % 3600) / 60

    positionA = ( aCalc / 12 * 100 ) % 100
    positionB = ( bCalc / 60 * 100 ) % 100

    difference = abs(positionA - positionB)
    if minimum > difference:
        minimum = difference
        minimumS = i

'''
aCalc0 = (sec + minimumS)  / 3600
bCalc0 = ((sec + minimumS) % 3600) / 60
positionA0 = ( aCalc0 / 12 * 100 ) % 100
positionB0 = ( bCalc0 / 60 * 100 ) % 100

aCalc1 = (sec + minimumS + 1)  / 3600
bCalc1 = ((sec + minimumS + 1) % 3600) / 60
positionA1 = ( aCalc1 / 12 * 100 ) % 100
positionB1 = ( bCalc1 / 60 * 100 ) % 100

if (positionA0 - positionB0)*(positionA1 - positionB1) < 0:
    minimumS += 1
'''
print(minimumS)
0