結果

問題 No.1043 直列大学
ユーザー pekempeypekempey
提出日時 2020-05-01 21:50:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 32,100 KB
最終ジャッジ日時 2023-08-26 09:14:34
合計ジャッジ時間 13,402 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 217 ms
31,784 KB
testcase_01 AC 221 ms
31,592 KB
testcase_02 AC 237 ms
31,712 KB
testcase_03 AC 221 ms
31,712 KB
testcase_04 AC 227 ms
31,636 KB
testcase_05 AC 225 ms
31,700 KB
testcase_06 AC 225 ms
31,588 KB
testcase_07 AC 230 ms
31,688 KB
testcase_08 AC 227 ms
31,772 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 485 ms
31,624 KB
testcase_12 WA -
testcase_13 AC 451 ms
32,100 KB
testcase_14 AC 461 ms
31,568 KB
testcase_15 AC 481 ms
31,588 KB
testcase_16 AC 457 ms
31,668 KB
testcase_17 AC 390 ms
31,972 KB
testcase_18 WA -
testcase_19 AC 440 ms
31,756 KB
testcase_20 AC 390 ms
31,692 KB
testcase_21 AC 437 ms
31,652 KB
testcase_22 WA -
testcase_23 AC 486 ms
31,852 KB
testcase_24 AC 407 ms
31,696 KB
testcase_25 AC 453 ms
31,588 KB
testcase_26 AC 464 ms
31,848 KB
testcase_27 AC 333 ms
31,624 KB
testcase_28 AC 649 ms
31,652 KB
testcase_29 AC 290 ms
31,936 KB
testcase_30 AC 378 ms
31,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def input_int():
    return int(input())

def input_ints():
    return list(map(int, input().split()))

import numpy as np

MOD = 10**9 + 7

N, M = input_ints()
V = input_ints()
R = input_ints()
A, B = input_ints()

dp = np.zeros(10**5 + 1, dtype=np.int64)
dp[0] = 1
for i in range(N):
    dp[V[i]:] += dp[:-V[i]]
    dp %= MOD

ep = np.zeros(10**5 + 1, dtype=np.int64)
ep[0] = 1
for i in range(M):
    ep[R[i]:] += ep[:-R[i]]
    ep %= MOD

ep = np.cumsum(ep)

ans = 0
for i in range(len(dp)):
    # i/B <= j <= i/A
    ans += dp[i] * ep[i // A]
    if i > 0:
        ans -= dp[i] * ep[(i + B - 1) // B - 1]
ans -= 1
print(ans % MOD)
0