結果

問題 No.897 compαctree
ユーザー nasadigital
提出日時 2019-10-04 21:33:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 436 bytes
コンパイル時間 1,464 ms
コンパイル使用メモリ 167,124 KB
実行使用メモリ 13,640 KB
最終ジャッジ日時 2024-10-03 07:19:09
合計ジャッジ時間 4,825 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int q, n, k;
    cin >> q;
    for (int ctr1 = 0; ctr1 < q; ++ctr1) {
        cin >> n >> k;
        ll cur = 1, rez = 0;
        while (n > cur) {
            n -= cur;
            cur *= k;
            ++rez;
        }
        cout << rez << "\n";
    }

    return 0;
}
0