結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
81,912 KB
testcase_01 AC 126 ms
81,616 KB
testcase_02 AC 128 ms
81,636 KB
testcase_03 AC 125 ms
81,840 KB
testcase_04 AC 125 ms
81,612 KB
testcase_05 AC 127 ms
81,724 KB
testcase_06 AC 126 ms
81,712 KB
testcase_07 WA -
testcase_08 AC 126 ms
81,736 KB
testcase_09 AC 124 ms
81,728 KB
testcase_10 AC 124 ms
81,716 KB
testcase_11 AC 124 ms
81,696 KB
testcase_12 WA -
testcase_13 AC 125 ms
81,628 KB
testcase_14 WA -
testcase_15 AC 124 ms
81,976 KB
testcase_16 WA -
testcase_17 AC 123 ms
81,600 KB
testcase_18 AC 125 ms
81,796 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 127 ms
81,788 KB
testcase_22 AC 127 ms
81,868 KB
testcase_23 AC 126 ms
81,884 KB
testcase_24 WA -
testcase_25 AC 125 ms
81,712 KB
testcase_26 AC 125 ms
81,908 KB
testcase_27 AC 124 ms
81,672 KB
testcase_28 WA -
testcase_29 AC 126 ms
81,852 KB
testcase_30 WA -
testcase_31 AC 125 ms
81,824 KB
testcase_32 AC 124 ms
81,828 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 124 ms
81,612 KB
testcase_36 AC 123 ms
81,740 KB
testcase_37 AC 124 ms
81,840 KB
testcase_38 WA -
testcase_39 AC 125 ms
82,004 KB
testcase_40 AC 127 ms
81,940 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 )

MI = min(S)

print (S,file=sys.stderr)

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


        
0