結果
| 問題 |
No.2961 Shiny Monster Master
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-16 16:42:33 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 492 bytes |
| コンパイル時間 | 3,126 ms |
| コンパイル使用メモリ | 250,816 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 16:42:40 |
| 合計ジャッジ時間 | 7,160 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 64 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll R,n;
cin>>R>>n;
vector<ll> a(n);
for(ll i=0;i<n;i++){
cin>>a[i];
}
sort(a.begin(),a.end());
ll q;
cin>>q;
while(q--){
ll l,r;
cin>>l>>r;
ll ans=0;
ans+=n-(lower_bound(a.begin(),a.end(),(l%R))-a.begin());
ll rest=max(0LL,(r-(l+R-l%R)));
ll n1=rest/R;
ll n2=rest%R;
ans+=n*n1;
ans+=(upper_bound(a.begin(),a.end(),n2)-a.begin());
cout<<ans<<endl;
}
}