結果

問題 No.46 はじめのn歩
コンテスト
ユーザー vjudge1
提出日時 2026-02-11 02:31:26
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 929 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,421 ms
コンパイル使用メモリ 333,880 KB
実行使用メモリ 7,976 KB
最終ジャッジ日時 2026-02-11 02:31:31
合計ジャッジ時間 4,717 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

#define int long long

typedef vector<int> vi;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define popcount __builtin_popcountll
int const MOD = 1e9 + 7;

void swapp(int &a, int &b) {
    a = a ^ b;
    b = a ^ b;
    a = a ^ b;
}

int mul(int a, int b) {
    if (log10l(a) + log10l(b) > 18.3) return 3e18;
    return a * b;
}

#define forn(i, a, b) for (int i = a; i < b; i++)

bool comp(pair<int, int> a, pair<int, int> b) {
    if (a.first == b.first) {
        return a.second > b.second;
    }
    return a.first < b.first;
}

void solve() {
    int a,b;cin>>a>>b;
    if(b%a == 0){
        cout<<a<<"\n";
    }
    else{
        cout<<min((b/a) + 1,a + 1)<<"\n";
    }
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    // cin >> t;
    forn(i,0,t){
        solve();
    }
    return 0;
}
0