結果

問題 No.1905 PURE PHRASE
ユーザー 👑 H20H20
提出日時 2022-04-15 22:41:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 35,744 KB
最終ジャッジ日時 2023-08-26 08:22:32
合計ジャッジ時間 8,355 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
34,696 KB
testcase_01 AC 160 ms
35,336 KB
testcase_02 AC 157 ms
35,148 KB
testcase_03 AC 159 ms
35,232 KB
testcase_04 AC 159 ms
35,552 KB
testcase_05 AC 157 ms
35,348 KB
testcase_06 AC 162 ms
35,460 KB
testcase_07 WA -
testcase_08 AC 162 ms
35,380 KB
testcase_09 AC 160 ms
35,512 KB
testcase_10 WA -
testcase_11 AC 156 ms
35,184 KB
testcase_12 WA -
testcase_13 AC 158 ms
35,716 KB
testcase_14 WA -
testcase_15 AC 159 ms
35,384 KB
testcase_16 WA -
testcase_17 AC 157 ms
35,228 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 156 ms
35,488 KB
testcase_22 WA -
testcase_23 AC 155 ms
35,280 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 156 ms
35,592 KB
testcase_28 WA -
testcase_29 AC 158 ms
35,336 KB
testcase_30 WA -
testcase_31 AC 157 ms
35,276 KB
testcase_32 AC 158 ms
35,552 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 158 ms
35,512 KB
testcase_36 WA -
testcase_37 AC 158 ms
35,360 KB
testcase_38 WA -
testcase_39 AC 158 ms
35,496 KB
testcase_40 AC 159 ms
35,408 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 = [261.6,294.3,327.0,348.8,392.4,436.0,490.5]
ans = 0
v = 1000
for i in range(7):
    if v>min(hz/HZ[i]-int(hz/HZ[i]),abs(1-hz/HZ[i]+int(hz/HZ[i])))*HZ[i]:
        v = min(hz/HZ[i]-int(hz/HZ[i]),abs(1-hz/HZ[i]+int(hz/HZ[i])))*HZ[i]
        ans=i
print(L[ans])
0