結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
81,644 KB
testcase_01 AC 84 ms
81,788 KB
testcase_02 AC 85 ms
81,772 KB
testcase_03 AC 85 ms
81,648 KB
testcase_04 AC 88 ms
81,496 KB
testcase_05 AC 86 ms
81,756 KB
testcase_06 AC 87 ms
81,684 KB
testcase_07 WA -
testcase_08 AC 85 ms
81,692 KB
testcase_09 AC 85 ms
81,764 KB
testcase_10 AC 84 ms
81,436 KB
testcase_11 AC 84 ms
81,500 KB
testcase_12 WA -
testcase_13 AC 88 ms
81,560 KB
testcase_14 WA -
testcase_15 AC 87 ms
81,500 KB
testcase_16 WA -
testcase_17 AC 85 ms
81,648 KB
testcase_18 AC 85 ms
81,688 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 88 ms
81,684 KB
testcase_22 AC 83 ms
81,564 KB
testcase_23 AC 86 ms
81,652 KB
testcase_24 WA -
testcase_25 AC 86 ms
81,752 KB
testcase_26 AC 87 ms
81,452 KB
testcase_27 AC 86 ms
81,632 KB
testcase_28 WA -
testcase_29 AC 86 ms
81,628 KB
testcase_30 WA -
testcase_31 AC 86 ms
81,468 KB
testcase_32 AC 86 ms
81,584 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 86 ms
81,500 KB
testcase_36 AC 85 ms
81,704 KB
testcase_37 AC 84 ms
81,704 KB
testcase_38 WA -
testcase_39 AC 86 ms
81,552 KB
testcase_40 AC 89 ms
81,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math

def get(idx):

    i = int(idx)
    rem = idx - i
    if i + 1 >= len(A):
        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:
            break
        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