結果

問題 No.1905 PURE PHRASE
ユーザー kys
提出日時 2022-04-15 22:59:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 511 ms / 2,000 ms
コード長 857 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 46,440 KB
最終ジャッジ日時 2024-12-25 02:10:01
合計ジャッジ時間 22,652 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
def iinput(): return int(input())
def sinput(): return input().rstrip()
def i0input(): return int(input()) - 1
def linput(): return list(input().split())
def liinput(): return list(map(int, input().split()))
def miinput(): return map(int, input().split())
def li0input(): return list(map(lambda x: int(x) - 1, input().split()))
def mi0input(): return map(lambda x: int(x) - 1, input().split())
INF = 10**20
MOD = 1000000007

import numpy as np

N = iinput()
A = liinput()

X = np.fft.fft(A)

X = list(map(abs, X))
res = 0
for i, x in enumerate(X[:500]):
    if x > res:
        res = x
        ans = i

K = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
KK = ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4']

res = INF
for i in range(7):
    if abs(ans-K[i]) < res:
        res = abs(ans-K[i])
        a = i

print(KK[a])
0