結果

問題 No.1905 PURE PHRASE
ユーザー mkawa2mkawa2
提出日時 2022-04-15 23:41:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 1,142 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 11,080 KB
実行使用メモリ 13,480 KB
最終ジャッジ日時 2023-08-26 08:52:06
合計ジャッジ時間 11,043 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 210 ms
12,796 KB
testcase_01 AC 211 ms
13,444 KB
testcase_02 AC 206 ms
13,244 KB
testcase_03 AC 231 ms
13,376 KB
testcase_04 AC 214 ms
13,160 KB
testcase_05 AC 213 ms
13,272 KB
testcase_06 AC 220 ms
13,280 KB
testcase_07 AC 230 ms
13,264 KB
testcase_08 AC 237 ms
13,288 KB
testcase_09 AC 225 ms
13,368 KB
testcase_10 AC 228 ms
13,084 KB
testcase_11 AC 231 ms
13,472 KB
testcase_12 AC 237 ms
13,308 KB
testcase_13 AC 216 ms
13,264 KB
testcase_14 AC 209 ms
13,444 KB
testcase_15 AC 225 ms
12,972 KB
testcase_16 AC 239 ms
13,308 KB
testcase_17 AC 214 ms
13,332 KB
testcase_18 AC 239 ms
13,160 KB
testcase_19 AC 219 ms
13,368 KB
testcase_20 AC 237 ms
13,236 KB
testcase_21 AC 227 ms
13,280 KB
testcase_22 AC 236 ms
13,184 KB
testcase_23 AC 221 ms
13,388 KB
testcase_24 AC 218 ms
13,224 KB
testcase_25 AC 235 ms
13,364 KB
testcase_26 AC 240 ms
13,316 KB
testcase_27 AC 214 ms
13,072 KB
testcase_28 AC 227 ms
13,480 KB
testcase_29 AC 225 ms
13,092 KB
testcase_30 AC 231 ms
13,324 KB
testcase_31 AC 223 ms
13,312 KB
testcase_32 AC 222 ms
13,236 KB
testcase_33 AC 219 ms
13,404 KB
testcase_34 AC 226 ms
13,272 KB
testcase_35 AC 228 ms
13,312 KB
testcase_36 AC 222 ms
13,304 KB
testcase_37 AC 225 ms
13,440 KB
testcase_38 AC 226 ms
13,160 KB
testcase_39 AC 239 ms
13,432 KB
testcase_40 AC 227 ms
13,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
# md = 10**9+7
md = 998244353

ss = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"]
fr = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]

n = II()
aa = LI()
ans = ""
mn = inf
for f, s in zip(fr, ss):
    t = 44100/f
    tot = 0
    cnt = 0
    for i in range(n):
        j = round(i+t)
        if j >= n: break
        tot += abs(aa[i]-aa[j])
        cnt += 1
    # print(s, tot, cnt, tot/cnt, mx)
    if tot/cnt < mn: mn, ans = tot/cnt, s

print(ans)
0