結果
| 問題 | No.3422 Sazanka's hobby |
| コンテスト | |
| ユーザー |
tau1235
|
| 提出日時 | 2026-01-11 13:47:41 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 773 ms / 2,000 ms |
| コード長 | 355 bytes |
| 記録 | |
| コンパイル時間 | 3,323 ms |
| コンパイル使用メモリ | 337,024 KB |
| 実行使用メモリ | 14,968 KB |
| 最終ジャッジ日時 | 2026-01-11 13:47:53 |
| 合計ジャッジ時間 | 8,816 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int dmax=2e6;
vector<int> d(n),c(dmax+1);
for (int i=0;i<n;i++){
int a,b;
cin>>a>>b;
d[i]=min(dmax,(m-a)/b);
c[d[i]]++;
}
int ans=0;
int now=0;
for (int i=0;i<=dmax;i++){
now+=c[i];
ans=max(ans,(now+i)/(i+1));
}
cout<<ans<<endl;
}
tau1235