結果

問題 No.1905 PURE PHRASE
ユーザー SumitacchanSumitacchan
提出日時 2022-02-11 18:11:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 537 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 35,460 KB
最終ジャッジ日時 2023-09-09 20:26:42
合計ジャッジ時間 11,652 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
34,816 KB
testcase_01 AC 149 ms
35,332 KB
testcase_02 AC 145 ms
35,460 KB
testcase_03 AC 151 ms
35,300 KB
testcase_04 AC 151 ms
35,096 KB
testcase_05 AC 150 ms
35,184 KB
testcase_06 AC 150 ms
35,172 KB
testcase_07 AC 148 ms
35,268 KB
testcase_08 AC 150 ms
35,148 KB
testcase_09 AC 150 ms
35,196 KB
testcase_10 AC 150 ms
34,972 KB
testcase_11 AC 150 ms
35,284 KB
testcase_12 AC 151 ms
35,056 KB
testcase_13 AC 149 ms
35,092 KB
testcase_14 AC 150 ms
35,040 KB
testcase_15 AC 150 ms
35,020 KB
testcase_16 AC 148 ms
35,020 KB
testcase_17 AC 150 ms
35,304 KB
testcase_18 AC 149 ms
35,192 KB
testcase_19 AC 149 ms
35,156 KB
testcase_20 AC 148 ms
35,108 KB
testcase_21 AC 148 ms
34,984 KB
testcase_22 AC 147 ms
35,240 KB
testcase_23 AC 148 ms
35,212 KB
testcase_24 AC 151 ms
34,956 KB
testcase_25 AC 151 ms
34,964 KB
testcase_26 AC 150 ms
34,892 KB
testcase_27 AC 151 ms
35,096 KB
testcase_28 AC 150 ms
35,152 KB
testcase_29 AC 148 ms
35,152 KB
testcase_30 AC 149 ms
35,016 KB
testcase_31 AC 149 ms
35,168 KB
testcase_32 AC 148 ms
34,984 KB
testcase_33 AC 148 ms
35,276 KB
testcase_34 AC 148 ms
35,096 KB
testcase_35 AC 148 ms
35,108 KB
testcase_36 AC 145 ms
35,036 KB
testcase_37 AC 149 ms
35,344 KB
testcase_38 AC 149 ms
35,256 KB
testcase_39 AC 146 ms
35,260 KB
testcase_40 AC 144 ms
35,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import numpy as np

N = int(input())
A = list(map(float, input().split()))
A = np.array(A)
F = np.abs(np.fft.fft(A))

candidate = { 'C4': 261.6, 'D4': 294.3, 'E4': 327.0, 'F4': 348.8, 'G4': 392.4, 'A4': 436.0, 'B4': 490.5  }
max_val = -1
ans = None
for k, f in candidate.items():
    val = F[int(np.round(f * 1.0))]
    if val > max_val:
        max_val = val
        ans = k

for k, f in candidate.items():
    if k != ans:
        val = F[int(np.round(f * 1.0))]
        assert(val < max_val * 0.5)

print(ans)
0