結果

問題 No.1905 PURE PHRASE
ユーザー 👑 colognecologne
提出日時 2022-04-16 11:34:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 13,820 KB
最終ジャッジ日時 2023-08-26 17:03:15
合計ジャッジ時間 6,521 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
13,060 KB
testcase_01 AC 102 ms
13,340 KB
testcase_02 AC 104 ms
13,492 KB
testcase_03 AC 101 ms
13,448 KB
testcase_04 AC 101 ms
13,408 KB
testcase_05 AC 103 ms
13,276 KB
testcase_06 AC 100 ms
13,408 KB
testcase_07 AC 101 ms
13,364 KB
testcase_08 AC 100 ms
13,496 KB
testcase_09 AC 101 ms
13,328 KB
testcase_10 AC 99 ms
13,540 KB
testcase_11 AC 103 ms
13,308 KB
testcase_12 AC 99 ms
13,788 KB
testcase_13 AC 102 ms
13,376 KB
testcase_14 AC 101 ms
13,404 KB
testcase_15 AC 103 ms
13,360 KB
testcase_16 AC 98 ms
13,468 KB
testcase_17 AC 101 ms
13,404 KB
testcase_18 AC 106 ms
13,768 KB
testcase_19 AC 101 ms
13,352 KB
testcase_20 AC 102 ms
13,292 KB
testcase_21 AC 102 ms
13,480 KB
testcase_22 AC 108 ms
13,724 KB
testcase_23 AC 100 ms
13,484 KB
testcase_24 AC 104 ms
13,276 KB
testcase_25 AC 106 ms
13,328 KB
testcase_26 AC 107 ms
13,352 KB
testcase_27 AC 109 ms
13,324 KB
testcase_28 AC 105 ms
13,412 KB
testcase_29 AC 101 ms
13,404 KB
testcase_30 AC 101 ms
13,440 KB
testcase_31 AC 105 ms
13,460 KB
testcase_32 AC 100 ms
13,820 KB
testcase_33 AC 104 ms
13,328 KB
testcase_34 AC 101 ms
13,404 KB
testcase_35 AC 100 ms
13,460 KB
testcase_36 AC 105 ms
13,620 KB
testcase_37 AC 102 ms
13,496 KB
testcase_38 AC 99 ms
13,324 KB
testcase_39 AC 107 ms
13,528 KB
testcase_40 AC 99 ms
13,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import cmath


def main():
    N = int(input())
    *A, = map(int, input().split())

    melody = [
        ("C4", 261.6),
        ("D4", 294.3),
        ("E4", 327.0),
        ("F4", 348.8),
        ("G4", 392.4),
        ("A4", 436.0),
        ("B4", 490.5),
    ]

    ans = 0
    ansv = 0

    for m, f in melody:
        angle = 2*math.pi*f/N
        s = 0
        for i in range(N):
            s += A[i] * cmath.exp(angle*i*1j)
        if ans < abs(s):
            ans = abs(s)
            ansv = m

    print(ansv)


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