結果

問題 No.1905 PURE PHRASE
ユーザー manta1130manta1130
提出日時 2022-04-15 22:01:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 35,804 KB
最終ジャッジ日時 2023-08-26 07:56:07
合計ジャッジ時間 8,405 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
34,952 KB
testcase_01 AC 138 ms
35,348 KB
testcase_02 AC 135 ms
35,284 KB
testcase_03 AC 137 ms
35,344 KB
testcase_04 AC 139 ms
35,648 KB
testcase_05 AC 137 ms
35,360 KB
testcase_06 AC 139 ms
35,448 KB
testcase_07 AC 137 ms
35,572 KB
testcase_08 AC 136 ms
35,476 KB
testcase_09 AC 137 ms
35,432 KB
testcase_10 AC 137 ms
35,544 KB
testcase_11 AC 143 ms
35,292 KB
testcase_12 AC 142 ms
35,648 KB
testcase_13 AC 136 ms
35,448 KB
testcase_14 AC 140 ms
35,316 KB
testcase_15 AC 137 ms
35,540 KB
testcase_16 AC 139 ms
35,412 KB
testcase_17 AC 141 ms
35,196 KB
testcase_18 AC 136 ms
35,460 KB
testcase_19 AC 140 ms
35,492 KB
testcase_20 AC 141 ms
35,452 KB
testcase_21 AC 141 ms
35,480 KB
testcase_22 AC 137 ms
35,492 KB
testcase_23 AC 143 ms
35,264 KB
testcase_24 AC 144 ms
35,480 KB
testcase_25 AC 146 ms
35,260 KB
testcase_26 AC 142 ms
35,528 KB
testcase_27 AC 139 ms
35,452 KB
testcase_28 AC 140 ms
35,332 KB
testcase_29 AC 143 ms
35,252 KB
testcase_30 AC 148 ms
35,328 KB
testcase_31 AC 140 ms
35,348 KB
testcase_32 AC 142 ms
35,540 KB
testcase_33 AC 141 ms
35,348 KB
testcase_34 AC 145 ms
35,576 KB
testcase_35 AC 148 ms
35,288 KB
testcase_36 AC 147 ms
35,804 KB
testcase_37 AC 139 ms
35,264 KB
testcase_38 AC 138 ms
35,576 KB
testcase_39 AC 140 ms
35,428 KB
testcase_40 AC 137 ms
35,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import bisect

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

f = np.fft.fft(a)
freq = np.fft.fftfreq(n, 1/n)
amp = np.abs(f/(n/2))


l = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
max = 0
maxval = 0.0
for i in range(len(l)):
    idx = bisect.bisect_left(freq[0:len(freq)//2], l[i])
    buf = amp[idx]

    if maxval < buf:
        max = i
        maxval = buf

if max == 0:
    print("C4")
if max == 1:
    print("D4")
if max == 2:
    print("E4")
if max == 3:
    print("F4")
if max == 4:
    print("G4")
if max == 5:
    print("A4")
if max == 6:
    print("B4")
0