結果
| 問題 | No.3422 Sazanka's hobby |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-11 13:47:23 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 198 ms / 2,000 ms |
| コード長 | 506 bytes |
| 記録 | |
| コンパイル時間 | 2,879 ms |
| コンパイル使用メモリ | 337,004 KB |
| 実行使用メモリ | 14,936 KB |
| 最終ジャッジ日時 | 2026-01-11 13:47:29 |
| 合計ジャッジ時間 | 5,600 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n, m, ans = 1;
cin >> n >> m;
vector<pair<int,int>> a(n);
vector<int> b(n + 1);
for(auto &&[x, y] : a){
cin >> x >> y;
int d = m - x;
d = (d + y - 1) / y;
b[min(n, d)]++;
}
int sv = 0;
for(int i = 1; i <= n; i++){
sv += b[i];
ans = max(ans, (sv + i - 1) / i);
}
cout << ans << '\n';
}