結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
34,028 KB
testcase_01 AC 137 ms
34,716 KB
testcase_02 AC 138 ms
34,524 KB
testcase_03 AC 135 ms
34,796 KB
testcase_04 AC 136 ms
34,568 KB
testcase_05 AC 131 ms
34,536 KB
testcase_06 AC 132 ms
34,728 KB
testcase_07 AC 131 ms
34,556 KB
testcase_08 AC 133 ms
34,764 KB
testcase_09 AC 133 ms
34,548 KB
testcase_10 AC 133 ms
34,412 KB
testcase_11 AC 135 ms
34,772 KB
testcase_12 AC 134 ms
34,684 KB
testcase_13 AC 135 ms
34,480 KB
testcase_14 AC 136 ms
34,580 KB
testcase_15 AC 134 ms
34,544 KB
testcase_16 AC 138 ms
34,724 KB
testcase_17 AC 135 ms
34,564 KB
testcase_18 AC 136 ms
34,428 KB
testcase_19 AC 139 ms
34,764 KB
testcase_20 WA -
testcase_21 AC 135 ms
34,580 KB
testcase_22 AC 132 ms
34,880 KB
testcase_23 AC 132 ms
34,716 KB
testcase_24 AC 135 ms
34,532 KB
testcase_25 AC 135 ms
34,568 KB
testcase_26 AC 133 ms
34,664 KB
testcase_27 AC 131 ms
34,556 KB
testcase_28 AC 139 ms
34,524 KB
testcase_29 AC 134 ms
34,436 KB
testcase_30 AC 133 ms
34,484 KB
testcase_31 AC 134 ms
34,404 KB
testcase_32 AC 133 ms
34,556 KB
testcase_33 AC 135 ms
34,608 KB
testcase_34 AC 136 ms
34,588 KB
testcase_35 AC 137 ms
34,712 KB
testcase_36 AC 134 ms
34,592 KB
testcase_37 AC 137 ms
34,504 KB
testcase_38 AC 135 ms
34,516 KB
testcase_39 AC 145 ms
34,680 KB
testcase_40 AC 133 ms
34,768 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).real

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

    return


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