結果

問題 No.1905 PURE PHRASE
ユーザー dn6049949
提出日時 2022-04-15 21:49:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 46,068 KB
最終ジャッジ日時 2024-12-25 00:26:16
合計ジャッジ時間 27,990 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
import numpy as np
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def IR(n):
    return [I() for _ in range(n)]
def LIR(n):
    return [LI() for _ in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007


hz = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
ch = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"]


def main():
    n = I()
    a = np.array(LI())

    acf = np.fft.ifft(a**2).real

    max_ = 0
    argmax = None
    for index,f in enumerate(hz):
        i = round(f)
        s = 0
        for j in range(i-3,i+4):
            s = max(s,abs(acf[j]))
        if max_ < s:
            max_ = s
            argmax = index
    print(ch[argmax])

    return


if __name__ == "__main__":
    main()
0