結果
問題 |
No.1905 PURE PHRASE
|
ユーザー |
![]() |
提出日時 | 2022-04-15 22:06:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 581 bytes |
コンパイル時間 | 142 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 47,064 KB |
最終ジャッジ日時 | 2024-12-25 00:42:32 |
合計ジャッジ時間 | 24,447 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 16 |
ソースコード
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')