結果
問題 |
No.2961 Shiny Monster Master
|
ユーザー |
|
提出日時 | 2024-11-16 16:59:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 1,764 ms |
コンパイル使用メモリ | 165,760 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-16 17:00:04 |
合計ジャッジ時間 | 12,564 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 RE * 61 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; #define REP(i,n) for(int i=0;i<int(n);i++) ll a[100010]; int main(void){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll i,j; ll R,N; cin >> R >> N; for(i=1;i<=N;i++){ ll x; cin >> x; a[x]=1; } for(i=1;i<R;i++) a[i]+=a[i-1]; int Q; cin >> Q; while(Q--){ ll l,r; cin >> l >> r; cout << r/R*N-(l-1)/R*N+a[r%R]-a[(l-1)%R] << endl; } return 0; }