結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
84,544 KB
testcase_01 AC 91 ms
79,144 KB
testcase_02 AC 119 ms
87,792 KB
testcase_03 AC 92 ms
79,140 KB
testcase_04 AC 91 ms
79,180 KB
testcase_05 AC 98 ms
80,960 KB
testcase_06 AC 97 ms
80,956 KB
testcase_07 AC 101 ms
82,612 KB
testcase_08 AC 103 ms
83,848 KB
testcase_09 AC 247 ms
158,136 KB
testcase_10 WA -
testcase_11 AC 355 ms
219,492 KB
testcase_12 AC 385 ms
236,692 KB
testcase_13 RE -
testcase_14 AC 325 ms
202,116 KB
testcase_15 RE -
testcase_16 AC 347 ms
213,264 KB
testcase_17 AC 262 ms
166,080 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 383 ms
236,844 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 181 ms
120,780 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+1)
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+1):
    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,B*j)]-dpV[min(10**5,A*j-1)])
    ans %= mod
print(ans)
0