結果

問題 No.1905 PURE PHRASE
コンテスト
ユーザー 37zigen
提出日時 2022-04-15 22:13:37
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 101 ms / 2,000 ms
+ 889µs
コード長 355 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 14,592 KB
実行使用メモリ 15,936 KB
最終ジャッジ日時 2026-10-20 04:46:54
合計ジャッジ時間 6,562 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

freq = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
word = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"]
N = int(input())
x = list(map(int, input().split()))

S = 10 ** 18
ans = -1
for i, f in enumerate(freq):
    d = round(N / f)
    s = sum([(x[i] - x[(i + d) % N]) ** 2 for i in range(N)])
    if s < S:
        S = s
        ans = i
print(word[ans])
0