結果
問題 |
No.1251 絶対に間違ってはいけない最小化問題
|
ユーザー |
|
提出日時 | 2020-10-21 11:06:55 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 347 bytes |
コンパイル時間 | 161 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 109,816 KB |
最終ジャッジ日時 | 2024-07-21 08:50:23 |
合計ジャッジ時間 | 13,829 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)