結果

問題 No.1905 PURE PHRASE
ユーザー milanis48663220milanis48663220
提出日時 2022-04-15 21:48:00
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 34,904 KB
最終ジャッジ日時 2023-08-26 07:45:54
合計ジャッジ時間 8,767 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
33,940 KB
testcase_01 AC 151 ms
34,272 KB
testcase_02 AC 151 ms
34,184 KB
testcase_03 AC 153 ms
34,272 KB
testcase_04 AC 152 ms
34,756 KB
testcase_05 AC 151 ms
34,868 KB
testcase_06 AC 150 ms
34,836 KB
testcase_07 AC 150 ms
34,664 KB
testcase_08 AC 152 ms
34,528 KB
testcase_09 AC 152 ms
34,816 KB
testcase_10 AC 152 ms
34,832 KB
testcase_11 AC 149 ms
34,144 KB
testcase_12 AC 151 ms
34,816 KB
testcase_13 AC 149 ms
34,844 KB
testcase_14 AC 149 ms
34,276 KB
testcase_15 AC 150 ms
34,532 KB
testcase_16 AC 151 ms
34,568 KB
testcase_17 AC 148 ms
34,228 KB
testcase_18 AC 152 ms
34,684 KB
testcase_19 AC 150 ms
34,284 KB
testcase_20 AC 151 ms
34,808 KB
testcase_21 AC 153 ms
34,352 KB
testcase_22 AC 153 ms
34,736 KB
testcase_23 AC 152 ms
34,380 KB
testcase_24 AC 150 ms
34,700 KB
testcase_25 AC 151 ms
34,612 KB
testcase_26 AC 153 ms
34,508 KB
testcase_27 AC 152 ms
34,632 KB
testcase_28 AC 152 ms
34,280 KB
testcase_29 AC 150 ms
34,392 KB
testcase_30 AC 150 ms
34,516 KB
testcase_31 AC 151 ms
34,184 KB
testcase_32 AC 152 ms
34,904 KB
testcase_33 AC 151 ms
34,248 KB
testcase_34 AC 153 ms
34,696 KB
testcase_35 AC 153 ms
34,636 KB
testcase_36 AC 153 ms
34,748 KB
testcase_37 AC 154 ms
34,268 KB
testcase_38 AC 153 ms
34,868 KB
testcase_39 AC 151 ms
34,568 KB
testcase_40 AC 153 ms
34,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import math

sound = {261.6: "C4", 294.3: "D4", 327.0: "E4", 348.8: "F4", 392.4: "G4", 436.0: "A4", 490.5: "B4"}

n = int(input())
a = np.array(list(map(int, input().split())))

ans = ""
min_norm = math.inf

for freq, kind in sound.items():
    cycle = int(n/freq)
    b = a[:-cycle]-a[cycle:]
    norm = np.linalg.norm(b)
    if norm < min_norm:
        min_norm = norm
        ans = kind

print(ans)
0