結果

問題 No.897 compαctree
ユーザー QDSN
提出日時 2019-12-05 04:16:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 1,607 ms
コンパイル使用メモリ 158,108 KB
実行使用メモリ 13,640 KB
最終ジャッジ日時 2024-12-15 19:42:57
合計ジャッジ時間 11,078 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
int main() {
    int q;
    cin >> q;
    while(q--) {
        ll n, k;
        cin >> n >> k;
        ll mul = 1, cum = 1;
        ll ans = 0;
        while(cum < n) {
            mul *= k;
            cum += mul;
            ans++;
        }
        cout << ans << endl;
    }
}
0