結果

問題 No.3355 対数の整数部分
コンテスト
ユーザー SnowBeenDiding
提出日時 2025-11-14 21:31:25
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 4,738 ms
コンパイル使用メモリ 335,296 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-11-14 21:31:44
合計ジャッジ時間 5,839 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(12);
    ll n, m;
    cin >> n >> m;
    __int128 N = n, M = m;
    ll ans = 0;
    auto f = [&](ll x) {
        __int128 cur = 1;
        rep(i, 0, x) {
            cur *= N;
            if (cur > m) return 0;
        }
        return 1;
    };
    while (f(ans + 1)) ans++;
    cout << ans << endl;
}
0