結果

問題 No.2359 A in S ?
ユーザー ニックネームニックネーム
提出日時 2023-06-24 00:40:52
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 564 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 963,016 KB
最終ジャッジ日時 2023-09-13 19:51:56
合計ジャッジ時間 7,688 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 171 ms
119,696 KB
testcase_02 AC 123 ms
79,516 KB
testcase_03 AC 107 ms
79,064 KB
testcase_04 AC 374 ms
155,896 KB
testcase_05 AC 685 ms
199,320 KB
testcase_06 AC 377 ms
153,296 KB
testcase_07 AC 259 ms
104,580 KB
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,m = map(int,input().split())
xylr = defaultdict(list)
for _ in range(n):
    l,r,x,y = map(int,input().split())
    xylr[(x,y)].append((l,r))
z = 10**5; a = [0]*(z+1)
d = [defaultdict(int) for _ in range(z+1)]
for (x,y),lr in xylr.items():
    for l,r in lr:
        p = l+(y-l%x)%x; q = r+1+(y-(r+1)%x)%x
        if p<=z: d[x][p] += 1
        if q<=z: d[x][q] -= 1
    for i in range(y,z+1-x,x): d[x][i+x] += d[x][i]
for x in range(1,z+1):
    for k,v in d[x].items(): a[k] += v
for v in map(int,input().split()): print(a[v])
0