結果

問題 No.1043 直列大学
ユーザー komkompikomkompi
提出日時 2020-05-02 00:23:17
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 666 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 110,792 KB
最終ジャッジ日時 2023-08-24 12:37:09
合計ジャッジ時間 6,825 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
78,196 KB
testcase_01 AC 79 ms
78,356 KB
testcase_02 AC 83 ms
78,448 KB
testcase_03 AC 79 ms
78,236 KB
testcase_04 AC 81 ms
78,484 KB
testcase_05 AC 81 ms
78,136 KB
testcase_06 AC 79 ms
78,332 KB
testcase_07 AC 82 ms
78,288 KB
testcase_08 AC 81 ms
78,324 KB
testcase_09 AC 117 ms
78,536 KB
testcase_10 AC 140 ms
82,388 KB
testcase_11 AC 216 ms
80,828 KB
testcase_12 AC 353 ms
110,792 KB
testcase_13 AC 235 ms
89,716 KB
testcase_14 AC 248 ms
88,096 KB
testcase_15 AC 305 ms
98,976 KB
testcase_16 AC 229 ms
85,772 KB
testcase_17 AC 139 ms
79,468 KB
testcase_18 AC 141 ms
79,384 KB
testcase_19 AC 232 ms
90,752 KB
testcase_20 AC 134 ms
79,320 KB
testcase_21 AC 209 ms
86,448 KB
testcase_22 AC 204 ms
84,632 KB
testcase_23 AC 323 ms
101,544 KB
testcase_24 AC 153 ms
81,292 KB
testcase_25 AC 207 ms
89,032 KB
testcase_26 AC 246 ms
88,440 KB
testcase_27 AC 116 ms
78,276 KB
testcase_28 AC 178 ms
80,268 KB
testcase_29 AC 97 ms
78,492 KB
testcase_30 AC 188 ms
84,880 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