結果

問題 No.2359 A in S ?
ユーザー ニックネームニックネーム
提出日時 2023-06-24 00:54:53
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 606 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 782,788 KB
最終ジャッジ日時 2023-09-13 20:06:27
合計ジャッジ時間 8,065 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
80,156 KB
testcase_01 AC 98 ms
73,172 KB
testcase_02 AC 125 ms
78,556 KB
testcase_03 AC 97 ms
73,264 KB
testcase_04 AC 395 ms
140,156 KB
testcase_05 AC 566 ms
153,772 KB
testcase_06 AC 385 ms
153,072 KB
testcase_07 AC 259 ms
95,256 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); d = {}
z = 10**5; a = [0]*(2*z+1)
for _ in range(n):
    l,r,x,y = map(int,input().split())
    xylr[(x,y)].append((l,r))
    if x not in d: d[x] = defaultdict(int)
for (x,y),lr in xylr.items():
    mi = z; ma = 0
    for l,r in lr:
        p = l+(y-l%x)%x; q = r+1+(y-(r+1)%x)%x
        mi = min(mi,p); ma = max(ma,q)
        d[x][p] += 1; d[x][q] -= 1
    for i in range(mi,ma-x+1,x): d[x][i+x] += d[x][i]
for dx in d.values():
    for k,v in dx.items(): a[k] += v
for v in map(int,input().split()): print(a[v])
0