結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 160 ms
35,288 KB
testcase_02 AC 157 ms
35,268 KB
testcase_03 AC 158 ms
34,924 KB
testcase_04 AC 162 ms
35,408 KB
testcase_05 AC 159 ms
35,520 KB
testcase_06 AC 157 ms
35,540 KB
testcase_07 WA -
testcase_08 AC 158 ms
35,332 KB
testcase_09 AC 160 ms
35,220 KB
testcase_10 AC 159 ms
35,320 KB
testcase_11 AC 158 ms
35,052 KB
testcase_12 WA -
testcase_13 AC 163 ms
35,348 KB
testcase_14 AC 163 ms
34,920 KB
testcase_15 AC 165 ms
35,300 KB
testcase_16 WA -
testcase_17 AC 162 ms
35,112 KB
testcase_18 WA -
testcase_19 AC 165 ms
35,060 KB
testcase_20 WA -
testcase_21 AC 160 ms
35,280 KB
testcase_22 AC 159 ms
35,284 KB
testcase_23 AC 167 ms
35,088 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 162 ms
35,368 KB
testcase_28 AC 160 ms
35,256 KB
testcase_29 AC 160 ms
35,352 KB
testcase_30 WA -
testcase_31 AC 159 ms
35,212 KB
testcase_32 AC 160 ms
35,260 KB
testcase_33 AC 159 ms
35,152 KB
testcase_34 WA -
testcase_35 AC 160 ms
35,044 KB
testcase_36 AC 164 ms
35,100 KB
testcase_37 AC 163 ms
35,016 KB
testcase_38 WA -
testcase_39 AC 163 ms
35,216 KB
testcase_40 AC 163 ms
35,368 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 = 1
for i in range(7):
    if v>min(hz/HZ[i]-int(hz/HZ[i]),abs(1-hz/HZ[i]-int(hz/HZ[i]))):
        v = min(hz/HZ[i]-int(hz/HZ[i]),abs(1-hz/HZ[i]-int(hz/HZ[i])))
        ans=i
print(L[ans])
0