結果

問題 No.1905 PURE PHRASE
ユーザー dn6049949dn6049949
提出日時 2022-04-15 21:49:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 34,936 KB
最終ジャッジ日時 2023-08-26 07:47:53
合計ジャッジ時間 8,389 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
33,864 KB
testcase_01 AC 154 ms
34,628 KB
testcase_02 AC 153 ms
34,632 KB
testcase_03 AC 152 ms
34,628 KB
testcase_04 AC 152 ms
34,444 KB
testcase_05 AC 153 ms
34,796 KB
testcase_06 AC 152 ms
34,572 KB
testcase_07 AC 153 ms
34,564 KB
testcase_08 AC 156 ms
34,600 KB
testcase_09 AC 151 ms
34,580 KB
testcase_10 AC 151 ms
34,292 KB
testcase_11 AC 153 ms
34,524 KB
testcase_12 AC 156 ms
34,580 KB
testcase_13 AC 160 ms
34,848 KB
testcase_14 AC 158 ms
34,628 KB
testcase_15 AC 157 ms
34,220 KB
testcase_16 AC 156 ms
34,632 KB
testcase_17 AC 156 ms
34,432 KB
testcase_18 AC 157 ms
34,712 KB
testcase_19 AC 158 ms
34,804 KB
testcase_20 AC 155 ms
34,560 KB
testcase_21 AC 152 ms
34,716 KB
testcase_22 AC 155 ms
34,744 KB
testcase_23 AC 155 ms
34,552 KB
testcase_24 AC 155 ms
34,760 KB
testcase_25 AC 153 ms
34,564 KB
testcase_26 AC 154 ms
34,624 KB
testcase_27 AC 155 ms
34,684 KB
testcase_28 AC 158 ms
34,424 KB
testcase_29 AC 159 ms
34,660 KB
testcase_30 AC 154 ms
34,576 KB
testcase_31 AC 152 ms
34,568 KB
testcase_32 WA -
testcase_33 AC 154 ms
34,516 KB
testcase_34 AC 153 ms
34,784 KB
testcase_35 AC 153 ms
34,688 KB
testcase_36 AC 152 ms
34,472 KB
testcase_37 WA -
testcase_38 AC 152 ms
34,436 KB
testcase_39 AC 153 ms
34,656 KB
testcase_40 AC 154 ms
34,560 KB
権限があれば一括ダウンロードができます

ソースコード

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