結果

問題 No.1905 PURE PHRASE
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-04-15 23:09:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 858 bytes
コンパイル時間 1,388 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 82,028 KB
最終ジャッジ日時 2023-08-26 08:39:46
合計ジャッジ時間 6,317 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
81,860 KB
testcase_01 AC 111 ms
81,908 KB
testcase_02 AC 112 ms
81,652 KB
testcase_03 AC 111 ms
81,756 KB
testcase_04 AC 110 ms
81,632 KB
testcase_05 AC 117 ms
81,836 KB
testcase_06 AC 111 ms
81,820 KB
testcase_07 WA -
testcase_08 AC 108 ms
81,884 KB
testcase_09 AC 113 ms
81,740 KB
testcase_10 AC 109 ms
81,708 KB
testcase_11 AC 108 ms
81,888 KB
testcase_12 WA -
testcase_13 AC 119 ms
81,752 KB
testcase_14 WA -
testcase_15 AC 109 ms
81,764 KB
testcase_16 WA -
testcase_17 AC 110 ms
81,864 KB
testcase_18 AC 110 ms
81,760 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 110 ms
81,744 KB
testcase_22 AC 107 ms
81,648 KB
testcase_23 AC 110 ms
81,620 KB
testcase_24 WA -
testcase_25 AC 109 ms
81,824 KB
testcase_26 AC 113 ms
81,864 KB
testcase_27 AC 111 ms
81,624 KB
testcase_28 WA -
testcase_29 AC 112 ms
81,736 KB
testcase_30 WA -
testcase_31 AC 109 ms
81,908 KB
testcase_32 AC 108 ms
81,640 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 114 ms
81,956 KB
testcase_36 AC 110 ms
81,988 KB
testcase_37 AC 111 ms
81,964 KB
testcase_38 WA -
testcase_39 AC 110 ms
81,772 KB
testcase_40 AC 115 ms
81,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math

def get(idx):

    i = int(idx)
    rem = idx - i
    if i + 1 >= len(A) or i < 0:
        return None

    ret = A[i] * (1-rem) + A[i+1] * rem
    return ret

N = int(stdin.readline())

A = list(map(int,stdin.readline().split()))

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

S = []

for freq in DF:

    ONE = N / freq
    nsum = 0
    nnum = 0

    for i in range(N):

        cat = get(i+ONE)
        if cat != None:
            nsum += abs(cat - A[i])**2
            nnum += 1

        cat = get(i-ONE)
        if cat != None:
            nsum += abs(cat - A[i])**2
            nnum += 1

    S.append( nsum / (nnum)**2 )

MI = min(S)

print (S,file=sys.stderr)

for i in range(6):
    if S[i] == MI:
        print (DN[i])
        break


        
0