結果

問題 No.1043 直列大学
ユーザー ValkyrjaValkyrja
提出日時 2020-05-12 00:00:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 535 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 35,652 KB
最終ジャッジ日時 2023-08-24 12:47:04
合計ジャッジ時間 13,373 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 191 ms
35,256 KB
testcase_01 AC 181 ms
35,196 KB
testcase_02 AC 195 ms
35,304 KB
testcase_03 AC 182 ms
35,244 KB
testcase_04 AC 181 ms
35,312 KB
testcase_05 AC 184 ms
35,160 KB
testcase_06 AC 180 ms
35,232 KB
testcase_07 AC 191 ms
35,236 KB
testcase_08 AC 190 ms
35,128 KB
testcase_09 AC 332 ms
35,260 KB
testcase_10 AC 371 ms
35,172 KB
testcase_11 AC 456 ms
35,240 KB
testcase_12 AC 535 ms
35,572 KB
testcase_13 AC 426 ms
35,460 KB
testcase_14 AC 440 ms
35,516 KB
testcase_15 AC 463 ms
35,536 KB
testcase_16 AC 436 ms
35,528 KB
testcase_17 AC 366 ms
35,512 KB
testcase_18 AC 401 ms
35,180 KB
testcase_19 AC 419 ms
35,572 KB
testcase_20 AC 362 ms
35,524 KB
testcase_21 AC 405 ms
35,652 KB
testcase_22 AC 410 ms
35,472 KB
testcase_23 AC 472 ms
35,420 KB
testcase_24 AC 393 ms
35,256 KB
testcase_25 AC 429 ms
35,544 KB
testcase_26 AC 445 ms
35,580 KB
testcase_27 AC 367 ms
35,588 KB
testcase_28 AC 421 ms
35,260 KB
testcase_29 AC 253 ms
35,108 KB
testcase_30 AC 354 ms
35,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=[int(j)for j in input().split()]
v=[int(j)for j in input().split()]
r=[int(j)for j in input().split()]
a,b=[int(j)for j in input().split()]
mod=10**9+7
import numpy as np
lv=np.zeros(10**5+1,dtype=np.int64)
lr=np.zeros(10**5+1,dtype=np.int64)
lv[0]=1
lr[0]=1
for i in v:
    lv[i:]+=lv[:-i]
    lv%=mod
for i in r:
    lr[i:]+=lr[:-i]
    lr%=mod
v_sum=[0]*(10**5+1)
for i in range(10**5):
    v_sum[i+1]=(v_sum[i]+lv[i])%mod

lv%=mod
lv[0]=0
ans=0
for i in np.where(lr[1:]>0)[0]:
    i=i+1
    if a*i>10**5:
        break
    ans=(ans+lr[i]*(v_sum[min(10**5,b*i+1)]-v_sum[a*i]))%mod

print(ans)
        



0