結果
| 問題 |
No.1251 絶対に間違ってはいけない最小化問題
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2020-12-14 08:02:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 183 bytes |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 112,708 KB |
| 最終ジャッジ日時 | 2024-09-20 00:30:37 |
| 合計ジャッジ時間 | 16,083 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 33 |
ソースコード
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
X=A.copy()
X.sort()
alpha=X[N//2]
S=0
for i in range(N):
S+=B[i]*abs(alpha-A[i])
print(alpha,S)
Kazun