結果
問題 |
No.1905 PURE PHRASE
|
ユーザー |
![]() |
提出日時 | 2022-04-15 21:43:39 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 947 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 65,920 KB |
最終ジャッジ日時 | 2024-12-25 00:19:56 |
合計ジャッジ時間 | 4,971 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 38 |
ソースコード
#!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-1,i+2): s += abs(acf[j]) if max_ < s: max_ = s argmax = index print(ch[argmax]) return if __name__ == "__main__": main()