結果
問題 | No.1043 直列大学 |
ユーザー | Nagisa |
提出日時 | 2020-05-01 22:56:19 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 10,832 KB |
実行使用メモリ | 14,668 KB |
最終ジャッジ日時 | 2023-08-26 15:37:41 |
合計ジャッジ時間 | 8,953 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 74 ms
9,568 KB |
testcase_01 | AC | 60 ms
9,664 KB |
testcase_02 | AC | 133 ms
9,620 KB |
testcase_03 | AC | 55 ms
9,592 KB |
testcase_04 | AC | 55 ms
9,512 KB |
testcase_05 | AC | 59 ms
9,548 KB |
testcase_06 | AC | 56 ms
9,564 KB |
testcase_07 | AC | 96 ms
9,604 KB |
testcase_08 | AC | 92 ms
9,524 KB |
testcase_09 | AC | 1,040 ms
14,352 KB |
testcase_10 | AC | 1,221 ms
14,616 KB |
testcase_11 | AC | 1,930 ms
14,668 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
ソースコード
N, M = map(int,input().split()) V = list(map(int,input().split())) R = list(map(int,input().split())) A, B = map(int,input().split()) MOD = 10**9 + 7 S = sum(V) D = [0]*(10**5+2) for e in V: for k in range(10**5+1,-1,-1): if D[k] > 0: D[k+e] += D[k] D[e] += 1 T = [0]*(10**5+2) for e in R: for k in range(10**5+1,-1,-1): if T[k] > 0: T[k+e] += T[k] T[e] += 1 for k in range(1,10**5+1): D[k] += D[k-1] ans = 0 for k in range(1,sum(R)+1): ans += T[k]*(D[min(S,k*B)]-D[max(0,min(S,k*A-1))]) ans %= MOD print(ans)