結果
| 問題 | No.1251 絶対に間違ってはいけない最小化問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-22 11:03:17 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 281 bytes |
| 記録 | |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 82,264 KB |
| 実行使用メモリ | 126,508 KB |
| 最終ジャッジ日時 | 2024-11-06 07:19:31 |
| 合計ジャッジ時間 | 16,440 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 40 |
ソースコード
from itertools import accumulate from bisect import bisect_left N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) BA=list(accumulate(B)) num=(BA[-1]+1)//2 idx=bisect_left(BA,num) ans=0 for i in range(N): ans+=B[i]*abs(A[idx]-A[i]) print(A[idx],ans)