結果

問題 No.1043 直列大学
ユーザー tikitaka1201tikitaka1201
提出日時 2020-07-08 22:55:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 777 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 82,644 KB
実行使用メモリ 92,712 KB
最終ジャッジ日時 2024-04-15 08:07:29
合計ジャッジ時間 5,599 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
76,628 KB
testcase_01 AC 66 ms
70,692 KB
testcase_02 AC 176 ms
76,964 KB
testcase_03 AC 56 ms
70,640 KB
testcase_04 AC 57 ms
70,544 KB
testcase_05 AC 130 ms
76,388 KB
testcase_06 AC 128 ms
76,264 KB
testcase_07 AC 62 ms
72,372 KB
testcase_08 AC 176 ms
76,992 KB
testcase_09 AC 211 ms
83,596 KB
testcase_10 AC 224 ms
85,208 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 107 ms
89,736 KB
testcase_15 AC 110 ms
91,200 KB
testcase_16 AC 104 ms
89,392 KB
testcase_17 AC 96 ms
85,272 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 138 ms
82,624 KB
testcase_28 AC 160 ms
89,264 KB
testcase_29 AC 132 ms
80,544 KB
testcase_30 AC 152 ms
85,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
*v,=map(int,input().split())
*r,=map(int,input().split())
a,b=map(int,input().split())
mod=10**9+7
dpv=[[0]*(10*1000+1) for _ in range(n+1)]
dpv[0][0]=1
dpr=[[0]*(10*1000+1) for _ in range(m+1)]
dpr[0][0]=1

for i in range(1,n+1):
    dpv[i][0]=1
    for j in range(10*1000+1):
        dpv[i][j]=dpv[i-1][j]
        if 0<=j-v[i-1]<=10*1000:
            dpv[i][j]+=dpv[i-1][j-v[i-1]]
        dpv[i][j]%=mod

for i in range(1,m+1):
    dpr[i][0]=1
    for j in range(10*1000+1):
        dpr[i][j]=dpr[i-1][j]
        if 0<=j-r[i-1]<=10*1000:
            dpr[i][j]+=dpr[i-1][j-r[i-1]]
        dpr[i][j]%=mod

dpv=dpv[-1]
dpr=dpr[-1]

ans=0
for R in range(1, 10*1000+1):
    ans+=(dpr[R]*sum(dpv[a*R:min(b*R+1,10*1000+1)]))%mod
    ans%=mod

print(ans)
0