結果

問題 No.1251 絶対に間違ってはいけない最小化問題
ユーザー proriboneproribone
提出日時 2020-10-09 22:11:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 110,364 KB
最終ジャッジ日時 2023-09-27 17:36:30
合計ジャッジ時間 17,775 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,320 KB
testcase_01 AC 65 ms
71,240 KB
testcase_02 AC 66 ms
71,108 KB
testcase_03 AC 64 ms
71,192 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 61 ms
71,412 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 62 ms
71,296 KB
testcase_11 WA -
testcase_12 AC 63 ms
75,536 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 64 ms
75,284 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 217 ms
106,016 KB
testcase_20 AC 150 ms
101,816 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 152 ms
101,172 KB
testcase_26 WA -
testcase_27 AC 79 ms
76,432 KB
testcase_28 AC 231 ms
110,312 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 220 ms
110,268 KB
testcase_33 AC 216 ms
110,288 KB
testcase_34 AC 219 ms
110,208 KB
testcase_35 AC 226 ms
110,228 KB
testcase_36 WA -
testcase_37 AC 217 ms
110,280 KB
testcase_38 AC 221 ms
110,288 KB
testcase_39 AC 216 ms
110,160 KB
testcase_40 AC 219 ms
110,236 KB
testcase_41 AC 223 ms
110,224 KB
testcase_42 WA -
testcase_43 AC 63 ms
71,108 KB
testcase_44 AC 64 ms
71,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def point(X):
    res=0
    for i in range(N):
        res+=B[i]*abs(X-A[i])
    return res

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

From,To=0,10**6
while(To-From>1):
    mid=(From+To)//2
    if point(mid)-point(mid-1)<0:
        From=mid
    else:
        To=mid
print(From,point(From))
0