結果

問題 No.1905 PURE PHRASE
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-04-15 23:33:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 873 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 106,740 KB
最終ジャッジ日時 2023-08-26 08:49:38
合計ジャッジ時間 15,033 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 308 ms
106,612 KB
testcase_01 AC 310 ms
106,616 KB
testcase_02 AC 310 ms
106,640 KB
testcase_03 AC 308 ms
106,232 KB
testcase_04 AC 306 ms
105,996 KB
testcase_05 AC 306 ms
106,312 KB
testcase_06 AC 306 ms
106,352 KB
testcase_07 AC 305 ms
106,084 KB
testcase_08 AC 305 ms
106,496 KB
testcase_09 AC 306 ms
106,432 KB
testcase_10 AC 308 ms
106,412 KB
testcase_11 AC 311 ms
106,508 KB
testcase_12 AC 308 ms
106,352 KB
testcase_13 AC 310 ms
106,644 KB
testcase_14 AC 311 ms
106,448 KB
testcase_15 AC 304 ms
106,612 KB
testcase_16 AC 304 ms
106,432 KB
testcase_17 AC 306 ms
106,584 KB
testcase_18 AC 307 ms
106,540 KB
testcase_19 AC 308 ms
106,492 KB
testcase_20 AC 305 ms
106,720 KB
testcase_21 AC 302 ms
106,368 KB
testcase_22 AC 304 ms
106,228 KB
testcase_23 AC 310 ms
106,240 KB
testcase_24 AC 307 ms
106,260 KB
testcase_25 AC 310 ms
106,596 KB
testcase_26 AC 308 ms
106,064 KB
testcase_27 AC 307 ms
106,328 KB
testcase_28 AC 304 ms
106,340 KB
testcase_29 AC 311 ms
106,740 KB
testcase_30 AC 310 ms
106,540 KB
testcase_31 AC 308 ms
106,264 KB
testcase_32 AC 310 ms
106,524 KB
testcase_33 AC 303 ms
105,776 KB
testcase_34 AC 305 ms
106,460 KB
testcase_35 AC 306 ms
106,512 KB
testcase_36 AC 302 ms
106,216 KB
testcase_37 AC 302 ms
106,372 KB
testcase_38 AC 307 ms
106,708 KB
testcase_39 AC 305 ms
106,684 KB
testcase_40 AC 306 ms
106,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import math
import random

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
    diff = []

    for i in range(10**5):

        L = random.uniform(0,N-1-ONE)

        catL = get(L)
        catR = get(L+ONE)

        
        if catL != None and catR != None:
            diff.append( abs(catL - catR)**2 )

    diff.sort()
    S.append( diff[len(diff)//2] )

MI = min(S)

print (S,file=sys.stderr)

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


        
0