結果
| 問題 |
No.1905 PURE PHRASE
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2022-04-15 21:45:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 73 ms / 2,000 ms |
| コード長 | 484 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 71,168 KB |
| 最終ジャッジ日時 | 2024-12-25 00:21:32 |
| 合計ジャッジ時間 | 4,418 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
def f(t):
time=0
X=0
for i in range(N-t):
X+=abs(A[i]-A[i+t])
time+=1
return X/time
#==================================================
from math import floor,ceil
N=int(input())
A=list(map(int,input().split()))
T={"C4":261.6, "D4":294.3, "E4":327.0, "F4":348.8, "G4":392.4, "A4":436.0, "B4":490.5}
beta=float("inf")
ans=""
for p in T:
alpha=min(f(floor(N/T[p])), f(ceil(N/T[p])))
if beta>alpha:
beta=alpha
ans=p
print(ans)
Kazun