結果
| 問題 | No.1251 絶対に間違ってはいけない最小化問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-21 11:06:55 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 347 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 95,984 KB |
| 実行使用メモリ | 130,816 KB |
| 最終ジャッジ日時 | 2026-08-21 11:18:35 |
| 合計ジャッジ時間 | 16,915 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 2 WA * 40 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
sumAB,sumB2,sumAB2 = 0,0,0
for a,b in zip(A,B):
sumAB += a*b
sumAB2 += ((a**2)*(b**2))
sumB2 += b**2
X = sumAB/sumB2
FX = 0
for a,b in zip(A,B):
FX += b*abs(X-a)
if X.is_integer():
X = int(X)
if FX.is_integer():
FX = int(FX)
print(X,FX)