結果
| 問題 | No.1251 絶対に間違ってはいけない最小化問題 |
| コンテスト | |
| ユーザー |
komkompi
|
| 提出日時 | 2020-10-17 21:27:18 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 397 bytes |
| 記録 | |
| コンパイル時間 | 758 ms |
| コンパイル使用メモリ | 21,280 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2026-08-21 01:09:49 |
| 合計ジャッジ時間 | 28,211 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | WA * 42 |
ソースコード
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=[[A[i],B[i]] for i in range(N)]
if N==1:
print(0,0)
exit()
sumB=sum(B)
C.sort(key=lambda x:x[0])
temp=0
for index in range(N-1):
temp+=B[index]
if temp>=sumB/2:
break
X=(C[index][0]+C[index+1][0])/2
ans=0
for a,b in C:
ans+=abs(X-a)*b
print(X,ans)
komkompi