結果

問題 No.897 compαctree
コンテスト
ユーザー shugo256
提出日時 2019-10-05 15:48:34
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 363 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 331 ms
コンパイル使用メモリ 84,480 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-10 21:22:18
合計ジャッジ時間 11,346 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 2 -- * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    int q; cin >> q;
    while (q--) {
        long n, k;
        cin >> n >> k;
        long d = -1, pow = 1;
        while (n > 0) { n -= pow; pow *= k; d++; }
        cout << d << '\n';
    }
    return 0;
}
0