結果

問題 No.1043 直列大学
ユーザー komkompikomkompi
提出日時 2020-05-02 00:22:58
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 666 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 25,024 KB
最終ジャッジ日時 2023-08-26 17:54:39
合計ジャッジ時間 9,784 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
10,448 KB
testcase_01 AC 114 ms
10,324 KB
testcase_02 AC 192 ms
10,448 KB
testcase_03 AC 112 ms
10,420 KB
testcase_04 AC 113 ms
10,496 KB
testcase_05 AC 113 ms
10,440 KB
testcase_06 AC 113 ms
10,328 KB
testcase_07 AC 141 ms
10,420 KB
testcase_08 AC 141 ms
10,420 KB
testcase_09 AC 1,009 ms
15,364 KB
testcase_10 AC 1,250 ms
15,436 KB
testcase_11 AC 1,814 ms
15,468 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 AC 1,615 ms
17,828 KB
testcase_18 AC 1,546 ms
17,572 KB
testcase_19 TLE -
testcase_20 AC 1,567 ms
17,628 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 AC 1,735 ms
17,992 KB
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 1,070 ms
16,836 KB
testcase_28 AC 1,894 ms
17,472 KB
testcase_29 AC 541 ms
13,668 KB
testcase_30 AC 1,724 ms
16,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())

V=list(map(int,input().split()))
R=list(map(int,input().split()))

A,B=map(int,input().split())
    
dp_V=[0]*(10**5+1)
dp_V[0]=1

for v in V:
    for i in range(len(dp_V))[::-1]:
            if dp_V[i]!=0:
                dp_V[i+v]+=dp_V[i]

dp_R=[0]*(10**5+1)
dp_R[0]=1

for r in R:
    for i in range(len(dp_R))[::-1]:
            if dp_R[i]!=0:
                dp_R[i+r]+=dp_R[i]

col_R=[0]*(10**5+1)
col_R[0]=0
for i in range(1,len(dp_R)):
    col_R[i]=col_R[i-1]+dp_R[i]
#print(dp_V)
#print(col_R)

ans=0
for i in range(1,len(dp_V)):
    low=-(-i//B)
    high=i//A
    ans+=(col_R[high]-col_R[low-1])*dp_V[i]
print(ans%(10**9+7))
0