結果

問題 No.1905 PURE PHRASE
ユーザー 👑 H20H20
提出日時 2022-04-15 22:49:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 35,416 KB
最終ジャッジ日時 2023-08-26 08:27:50
合計ジャッジ時間 7,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
34,572 KB
testcase_01 AC 144 ms
35,172 KB
testcase_02 AC 143 ms
35,148 KB
testcase_03 AC 141 ms
35,156 KB
testcase_04 AC 143 ms
35,056 KB
testcase_05 AC 144 ms
35,204 KB
testcase_06 AC 142 ms
35,248 KB
testcase_07 AC 145 ms
35,216 KB
testcase_08 AC 142 ms
34,996 KB
testcase_09 AC 138 ms
35,344 KB
testcase_10 AC 138 ms
35,404 KB
testcase_11 AC 142 ms
35,132 KB
testcase_12 AC 139 ms
35,368 KB
testcase_13 AC 140 ms
35,268 KB
testcase_14 AC 143 ms
35,124 KB
testcase_15 AC 144 ms
35,216 KB
testcase_16 AC 140 ms
35,232 KB
testcase_17 AC 140 ms
34,900 KB
testcase_18 AC 141 ms
35,324 KB
testcase_19 AC 142 ms
35,112 KB
testcase_20 AC 140 ms
35,404 KB
testcase_21 AC 138 ms
35,292 KB
testcase_22 AC 137 ms
35,188 KB
testcase_23 AC 137 ms
35,200 KB
testcase_24 AC 142 ms
35,416 KB
testcase_25 AC 139 ms
35,276 KB
testcase_26 AC 141 ms
35,408 KB
testcase_27 AC 144 ms
35,324 KB
testcase_28 AC 140 ms
35,108 KB
testcase_29 AC 145 ms
35,372 KB
testcase_30 AC 138 ms
35,068 KB
testcase_31 AC 142 ms
34,960 KB
testcase_32 AC 139 ms
35,120 KB
testcase_33 AC 141 ms
35,140 KB
testcase_34 AC 142 ms
35,328 KB
testcase_35 AC 141 ms
35,292 KB
testcase_36 AC 140 ms
35,324 KB
testcase_37 AC 139 ms
35,164 KB
testcase_38 AC 141 ms
35,272 KB
testcase_39 AC 142 ms
35,268 KB
testcase_40 AC 139 ms
35,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N = int(input())
A = list(map(int, input().split())) 
F = np.fft.fft(A)
# 振幅スペクトルを計算
amplitude = np.abs(F)
F_amplitude = amplitude / N * 2
F_amplitude[0] = F_amplitude[0] / 2
v = 0
hz = 0
for i in range(len(F_amplitude)):
	if v<F_amplitude[i]:
		hz=i
		v=F_amplitude[i]
L = ['C4','D4','E4','F4','G4','A4','B4']
HZ = [260,293,326,347,391,435,489]
V = [0]*7
for i in range(7):
    for k in range(1,7):
        for j in range(3):
            V[i]+=F_amplitude[HZ[i]*k+j]
ans = 0
v = 0
for i in range(7):
    if v<V[i]:
        ans=i
        v=V[i]
print(L[ans])
0