結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
35,052 KB
testcase_01 AC 157 ms
35,208 KB
testcase_02 AC 157 ms
35,216 KB
testcase_03 AC 155 ms
35,176 KB
testcase_04 AC 158 ms
35,388 KB
testcase_05 AC 157 ms
35,404 KB
testcase_06 AC 157 ms
35,388 KB
testcase_07 WA -
testcase_08 AC 161 ms
35,408 KB
testcase_09 AC 158 ms
35,404 KB
testcase_10 WA -
testcase_11 AC 156 ms
35,372 KB
testcase_12 WA -
testcase_13 AC 158 ms
35,472 KB
testcase_14 WA -
testcase_15 AC 161 ms
35,420 KB
testcase_16 WA -
testcase_17 AC 162 ms
35,336 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 163 ms
35,436 KB
testcase_22 WA -
testcase_23 AC 156 ms
35,352 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 158 ms
35,488 KB
testcase_28 WA -
testcase_29 AC 157 ms
35,336 KB
testcase_30 WA -
testcase_31 AC 155 ms
35,128 KB
testcase_32 AC 155 ms
35,564 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 158 ms
35,508 KB
testcase_36 WA -
testcase_37 AC 155 ms
35,148 KB
testcase_38 WA -
testcase_39 AC 163 ms
35,520 KB
testcase_40 AC 160 ms
35,536 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]/HZ[0]:
        v = min(hz/HZ[i]-int(hz/HZ[i]),abs(1-hz/HZ[i]+int(hz/HZ[i])))*HZ[i]/HZ[0]
        ans=i
print(L[ans])
0