結果

問題 No.897 compαctree
ユーザー kikage
提出日時 2020-03-23 19:38:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 297 bytes
コンパイル時間 985 ms
コンパイル使用メモリ 58,464 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-12-26 18:09:38
合計ジャッジ時間 10,968 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
int main(){
    long long Q,N,K;
    cin >> Q;
    for(int i=0;i<Q;i++){
        cin >> N >> K;
        int h=0;N--;
        while(N>0){
            N-=pow(K,h+1);
            h++;
        }
        cout << h << endl;
    }
    return 0;
}
0