結果

問題 No.2961 Shiny Monster Master
コンテスト
ユーザー 👑 rin204
提出日時 2024-11-16 21:47:05
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 90 ms / 1,777 ms
+ 868µs
コード長 306 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 525 ms
コンパイル使用メモリ 81,360 KB
実行使用メモリ 98,172 KB
最終ジャッジ日時 2026-09-25 01:23:50
合計ジャッジ時間 9,065 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 77
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from bisect import bisect_right

R, n = map(int, input().split())
A = list(map(int, input().split()))
A.sort()


def f(x):
    tot = (x // R) * n
    x %= R
    tot += bisect_right(A, x)

    return tot


Q = int(input())

for _ in range(Q):
    l, r = map(int, input().split())
    print(f(r) - f(l - 1))
0