結果

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

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

int main(){
    int Q;
    cin >> Q;
    for(int i=0;i<Q;i++){
        ll n,k;
        cin >> n >> k;
        ll node = 1;
        ll ans = 1;
        ll sum = 1;
        while(sum<n){
            node *= k;
            sum += node;
            ans++;
        }
        cout << --ans << endl;
    }
}
0