結果

問題 No.1043 直列大学
ユーザー kohei2019kohei2019
提出日時 2022-07-14 00:13:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 792 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 236,692 KB
最終ジャッジ日時 2023-09-07 11:17:41
合計ジャッジ時間 9,817 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
84,368 KB
testcase_01 AC 81 ms
79,228 KB
testcase_02 AC 107 ms
87,652 KB
testcase_03 AC 85 ms
79,184 KB
testcase_04 AC 81 ms
79,168 KB
testcase_05 AC 87 ms
80,928 KB
testcase_06 AC 86 ms
80,812 KB
testcase_07 AC 93 ms
82,508 KB
testcase_08 AC 93 ms
84,112 KB
testcase_09 AC 235 ms
158,112 KB
testcase_10 WA -
testcase_11 AC 323 ms
219,380 KB
testcase_12 AC 360 ms
236,692 KB
testcase_13 RE -
testcase_14 AC 307 ms
202,184 KB
testcase_15 RE -
testcase_16 AC 328 ms
213,088 KB
testcase_17 AC 246 ms
165,980 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 377 ms
236,672 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 171 ms
120,748 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
lsV = list(map(int,input().split()))
lsR = list(map(int,input().split()))
A,B = map(int,input().split())
mod = 10**9+7
dpV = [0]*(10**5+2)
dpV[0] = 1
for j in range(N):
    dpV2 = dpV[:]
    for i in range(10**5+1):    
        if i + lsV[j] <= 10**5:
            dpV2[i + lsV[j]] += dpV[i]
            dpV2[i + lsV[j]] %= mod
    dpV = dpV2

dpR = [0]*(10**5+1)
dpR[0] = 1
for j in range(N):
    dpR2 = dpR[:]
    for i in range(10**5+1):    
        if i + lsR[j] <= 10**5:
            dpR2[i + lsR[j]] += dpR[i]
            dpR2[i + lsR[j]] %= mod
    dpR = dpR2


for i in range(1,10**5+2):
    dpV[i] += dpV[i-1]
    dpV[i] %= mod
ans = 0
for j in range(1,10**5+1):
    ans += dpR[j]*(dpV[min(10**5+1,B*j)]-dpV[min(10**5,A*j-1)])
    ans %= mod
print(ans)
0