結果
問題 | 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
|
実行時間 | 553 ms / 2,000 ms |
コード長 | 1,584 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 46,980 KB |
最終ジャッジ日時 | 2024-06-07 03:41:58 |
合計ジャッジ時間 | 23,378 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 495 ms
46,136 KB |
testcase_01 | AC | 501 ms
46,508 KB |
testcase_02 | AC | 493 ms
46,476 KB |
testcase_03 | AC | 496 ms
46,980 KB |
testcase_04 | AC | 499 ms
46,500 KB |
testcase_05 | AC | 505 ms
46,556 KB |
testcase_06 | AC | 507 ms
46,440 KB |
testcase_07 | AC | 499 ms
46,952 KB |
testcase_08 | AC | 496 ms
46,804 KB |
testcase_09 | AC | 491 ms
46,380 KB |
testcase_10 | AC | 496 ms
46,500 KB |
testcase_11 | AC | 549 ms
46,696 KB |
testcase_12 | AC | 553 ms
46,460 KB |
testcase_13 | AC | 498 ms
46,468 KB |
testcase_14 | AC | 499 ms
46,500 KB |
testcase_15 | AC | 494 ms
46,500 KB |
testcase_16 | AC | 503 ms
46,392 KB |
testcase_17 | AC | 498 ms
46,624 KB |
testcase_18 | AC | 505 ms
46,364 KB |
testcase_19 | AC | 507 ms
46,588 KB |
testcase_20 | AC | 505 ms
46,420 KB |
testcase_21 | AC | 492 ms
46,412 KB |
testcase_22 | AC | 499 ms
46,500 KB |
testcase_23 | AC | 495 ms
46,580 KB |
testcase_24 | AC | 510 ms
46,552 KB |
testcase_25 | AC | 509 ms
46,776 KB |
testcase_26 | AC | 503 ms
46,416 KB |
testcase_27 | AC | 512 ms
46,572 KB |
testcase_28 | AC | 503 ms
46,592 KB |
testcase_29 | AC | 498 ms
46,636 KB |
testcase_30 | AC | 504 ms
46,392 KB |
testcase_31 | AC | 511 ms
46,372 KB |
testcase_32 | AC | 500 ms
46,496 KB |
testcase_33 | AC | 499 ms
46,592 KB |
testcase_34 | AC | 506 ms
46,548 KB |
testcase_35 | AC | 503 ms
46,672 KB |
testcase_36 | AC | 514 ms
46,504 KB |
testcase_37 | AC | 495 ms
46,832 KB |
testcase_38 | AC | 501 ms
46,424 KB |
testcase_39 | AC | 505 ms
46,504 KB |
testcase_40 | AC | 506 ms
46,440 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])) #