結果

問題 No.1905 PURE PHRASE
ユーザー ニックネーム
提出日時 2022-04-15 21:57:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 347 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 15,556 KB
最終ジャッジ日時 2024-12-25 00:33:09
合計ジャッジ時間 4,189 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(1, n-1):
    if a[i-1] <= a[i] >= a[i+1]: c += 1
h = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"]
f = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5]
i = bisect_left(f, c)
if i > 5: i = 5
print(h[i] if abs(v-f[i]) < abs(v-f[i+1]) else h[i+1])
0