結果
問題 | No.1043 直列大学 |
ユーザー | titia |
提出日時 | 2020-05-01 21:58:08 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 642 bytes |
コンパイル時間 | 1,097 ms |
コンパイル使用メモリ | 86,936 KB |
実行使用メモリ | 190,596 KB |
最終ジャッジ日時 | 2023-08-26 09:43:25 |
合計ジャッジ時間 | 6,551 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
71,332 KB |
testcase_01 | AC | 81 ms
71,352 KB |
testcase_02 | AC | 81 ms
71,280 KB |
testcase_03 | AC | 83 ms
71,348 KB |
testcase_04 | AC | 79 ms
71,500 KB |
testcase_05 | AC | 79 ms
71,388 KB |
testcase_06 | AC | 82 ms
71,456 KB |
testcase_07 | AC | 82 ms
71,448 KB |
testcase_08 | AC | 87 ms
71,364 KB |
testcase_09 | AC | 304 ms
77,724 KB |
testcase_10 | AC | 329 ms
78,216 KB |
testcase_11 | AC | 258 ms
78,628 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 | -- | - |
ソースコード
import sys input = sys.stdin.readline 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=1000000007 from collections import Counter C=Counter() C[0]=1 for v in V: NC=Counter() for c in C: NC[c]=(NC[c]+C[c])%mod NC[c+v]=(NC[c+v]+C[c])%mod C=NC C2=Counter() C2[0]=1 for r in R: NC2=Counter() for c2 in C2: NC2[c2]=(NC2[c2]+C2[c2])%mod NC2[c2+r]=(NC2[c2+r]+C2[c2])%mod C2=NC2 del(C[0]) del(C2[0]) ANS=0 for c in C: for c2 in C2: if A*c2<=c<=B*c2: ANS=(ANS+C[c]*C2[c2])%mod print(ANS)