結果

問題 No.1905 PURE PHRASE
ユーザー siganai
提出日時 2022-04-15 21:49:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 853 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 74,368 KB
最終ジャッジ日時 2024-12-25 00:26:27
合計ジャッジ時間 4,443 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env PyPy3

from collections import Counter, defaultdict, deque
import itertools
import re
import math
from functools import reduce
import operator
import bisect
import heapq
import functools
mod=10**9+7

import sys
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
l = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
cntl = []
for i in range(7):
    cntl.append(int(44100//l[i]))

data = [0] * 7
for i in range(7):
    for j in range(cntl[i]):
        data[i] += (a[j+cntl[i]] - a[j]) ** 2

for i in range(7):
    data[i] *= l[i]

mi = min(data)
for i in range(7):
    if mi == data[i]:
        ind = i
if ind == 0:
    print('C4')
elif ind == 1:
    print('D4')
elif ind == 2:
    print('E4')
elif ind == 3:
    print('F4')
elif ind == 4:
    print('G4')
elif ind == 5:
    print('A4')
elif ind == 6:
    print('B4')
0