結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-22 23:40:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 397 bytes |
| コンパイル時間 | 345 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-11-06 23:15:57 |
| 合計ジャッジ時間 | 1,056 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 5 |
ソースコード
n=int(input())
k=int(input())
lst=[int(input()) for _ in range(n)]
m=(n+k-1)//k
m_r=n%m
kk=[m]*k if m_r==0 else [m]*(k-1)+[m_r]
# print(lst,kk)
def zin():
i=0
ans_lst=[]
while(i<n):
for j in kk:
tmp=sum(lst[i:i+j])
i+=j
ans_lst.append(tmp/j if j!=0 else 0)
# print(ans_lst)
return max(ans_lst)-min(ans_lst)
print(int((zin()+0.5)//1))