結果
問題 | No.2495 Three Sets |
ユーザー |
👑 |
提出日時 | 2023-09-05 18:43:37 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 624 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 10,860 KB |
実行使用メモリ | 15,240 KB |
最終ジャッジ日時 | 2023-09-06 08:27:02 |
合計ジャッジ時間 | 7,310 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 23 ms
12,676 KB |
testcase_01 | AC | 24 ms
8,440 KB |
testcase_02 | AC | 26 ms
8,388 KB |
testcase_03 | AC | 23 ms
8,356 KB |
testcase_04 | AC | 23 ms
8,340 KB |
testcase_05 | AC | 24 ms
8,348 KB |
testcase_06 | AC | 25 ms
8,388 KB |
testcase_07 | AC | 25 ms
8,308 KB |
testcase_08 | AC | 24 ms
8,300 KB |
testcase_09 | AC | 64 ms
8,256 KB |
testcase_10 | AC | 88 ms
8,328 KB |
testcase_11 | AC | 529 ms
8,424 KB |
testcase_12 | AC | 1,217 ms
8,484 KB |
testcase_13 | TLE | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
コンパイルメッセージ
Main.py:16: SyntaxWarning: invalid decimal literal for x in X:A[-x]=A[-x]+1if -x in A else 1
ソースコード
R=range I=lambda:list(map(int,input().split())) N=I() B=3000 W=6002 L=[] S=[] U=[] C=[B] for n in R(3): S+=[[0]] U+=[[0]] L+=[1] X=I() A={-B:0} for x in X:A[-x]=A[-x]+1if -x in A else 1 for a in sorted(A): S[n]+=[S[n][L[n]-1]+A[a]] U[n]+=[U[n][L[n]-1]-a*A[a]] if n>1:C+=[-a] L[n]+=1 X=[] for x in R(W): a=l=0 r=L[2] while l+1<r: m=(l+r)//2 if C[m]>=x-B:l=m else:r=m X+=[l] for i in R(L[0]): for j in R(L[1]): if U[1][j]+B*S[0][i]>=0: if S[0][i]<1:m=L[2]-1 else: r=max(0,-(U[1][j]//S[0][i])+B) m=[0,X[r]][r<W] if m:a=max(a,U[0][i]*S[1][j]+U[1][j]*S[2][m]+U[2][m]*S[0][i]) print(a)