結果

問題 No.1905 PURE PHRASE
ユーザー H20
提出日時 2022-04-15 22:06:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 581 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 65,280 KB
最終ジャッジ日時 2024-12-25 00:42:03
合計ジャッジ時間 4,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
N = int(input())
A = list(map(int, input().split())) 

# 高速フーリエ変換(FFT)
F = np.fft.fft(A)
# 振幅スペクトルを計算
amplitude = np.abs(F)
F_amplitude = amplitude / N * 2
F_amplitude[0] = F_amplitude[0] / 2
v = 0
ans = 0
for i in range(len(F_amplitude)):
	if v<F_amplitude[i]:
		ans=i
		v=F_amplitude[i]
if 1569<=ans<=1571:
    print('C4')
elif 292<=ans<=295:
    print('D4')
elif 326<=ans<=328:
    print('E4')
elif 348<=ans<=350:
    print('F4')
elif 391<=ans<=395:
    print('G4')
elif 435<=ans<=437:
    print('A4')
else:
    print('B4')
0