結果
問題 | No.1905 PURE PHRASE |
ユーザー | U S |
提出日時 | 2022-04-15 22:47:56 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 1,584 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 10,996 KB |
実行使用メモリ | 35,732 KB |
最終ジャッジ日時 | 2023-08-26 08:26:54 |
合計ジャッジ時間 | 8,232 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 135 ms
34,768 KB |
testcase_01 | AC | 132 ms
35,408 KB |
testcase_02 | AC | 132 ms
35,340 KB |
testcase_03 | AC | 137 ms
35,204 KB |
testcase_04 | AC | 135 ms
35,364 KB |
testcase_05 | AC | 133 ms
35,372 KB |
testcase_06 | AC | 138 ms
35,648 KB |
testcase_07 | AC | 135 ms
35,412 KB |
testcase_08 | AC | 134 ms
35,276 KB |
testcase_09 | AC | 135 ms
35,524 KB |
testcase_10 | AC | 136 ms
35,592 KB |
testcase_11 | AC | 134 ms
35,216 KB |
testcase_12 | AC | 133 ms
35,700 KB |
testcase_13 | AC | 131 ms
35,536 KB |
testcase_14 | AC | 131 ms
35,320 KB |
testcase_15 | AC | 137 ms
35,440 KB |
testcase_16 | AC | 136 ms
35,664 KB |
testcase_17 | AC | 132 ms
35,280 KB |
testcase_18 | AC | 134 ms
35,380 KB |
testcase_19 | AC | 130 ms
35,168 KB |
testcase_20 | AC | 136 ms
35,700 KB |
testcase_21 | AC | 134 ms
35,616 KB |
testcase_22 | AC | 135 ms
35,416 KB |
testcase_23 | AC | 137 ms
35,272 KB |
testcase_24 | AC | 139 ms
35,732 KB |
testcase_25 | AC | 138 ms
35,372 KB |
testcase_26 | AC | 133 ms
35,456 KB |
testcase_27 | AC | 140 ms
35,460 KB |
testcase_28 | AC | 136 ms
35,452 KB |
testcase_29 | AC | 131 ms
35,244 KB |
testcase_30 | AC | 136 ms
35,368 KB |
testcase_31 | AC | 134 ms
35,360 KB |
testcase_32 | AC | 132 ms
35,644 KB |
testcase_33 | AC | 134 ms
35,192 KB |
testcase_34 | AC | 134 ms
35,584 KB |
testcase_35 | AC | 134 ms
35,224 KB |
testcase_36 | AC | 130 ms
35,440 KB |
testcase_37 | AC | 132 ms
35,304 KB |
testcase_38 | AC | 134 ms
35,644 KB |
testcase_39 | AC | 135 ms
35,388 KB |
testcase_40 | AC | 133 ms
35,404 KB |
ソースコード
# import sys # input = sys.stdin.readline # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') def mp():return map(int,input().split()) def lmp():return list(map(int,input().split())) def mps(A):return [tuple(map(int, input().split())) for _ in range(A)] def stoi(LIST):return list(map(int,LIST)) def itos(LIST):return list(map(str,LIST)) def bitA(X,A):return X & 1<<A == 1<<A import math import bisect import heapq import time from copy import copy as cc from copy import deepcopy as dc from itertools import accumulate, product from collections import Counter, defaultdict, deque def ceil(U,V):return (U+V-1)//V def modf1(N,MOD):return (N-1)%MOD+1 inf = int(1e18+20) mod = 998244353 import numpy as np n = int(input()) a = lmp() hz = [261.6,294.3,327,348.8,392.4,436,490.5] al = ["C","D","E","F","G","A","B"] F = np.fft.fft(a) amp = np.abs(F) ans = -1 h = -inf for i in range(510): if amp[i] > h: ans = i h = amp[i] er = inf now = -1 for i in range(7): ner = abs(ans-hz[i]) if ner < er: er = ner now = i print("{}4".format(al[now])) # def calc_var(lst): # mean = sum(lst)/len(lst) # var = 0 # for i in lst: # var += (i-mean)**2 # var /= len(lst) # return var # # # ans = -1 # er = inf # for i in range(7): # now = [[] for _ in range(hz[i])] # for j in range(n): # now[j%hz[i]].append(a[j]) # v = [] # for j in now: # v.append(calc_var(j)) # ter = max(v) # if ter < er: # er = ter # ans = i # print(ter) # print("{}4".format(al[ans])) #