結果

問題 No.3422 Sazanka's hobby
コンテスト
ユーザー GOTKAKO
提出日時 2026-01-11 13:41:32
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 225 ms / 2,000 ms
コード長 428 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,996 ms
コンパイル使用メモリ 217,696 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2026-01-11 13:41:44
合計ジャッジ時間 4,554 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N,M; cin >> N >> M;
    vector<int> D(N);
    for(auto &d : D){
        int a,b; cin >> a >> b;
        d = (M-a)/b+1;
    }
    sort(D.begin(),D.end());
    int answer = 0;
    for(int i=0; i<N; i++){
        int d = D.at(i);
        answer = max(answer,(i+d)/d);
    }
    cout << answer << "\n";
}
0