結果

問題 No.897 compαctree
ユーザー kikagekikage
提出日時 2020-03-23 19:38:32
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 297 bytes
コンパイル時間 1,372 ms
コンパイル使用メモリ 58,176 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-08-27 06:49:36
合計ジャッジ時間 5,524 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,000 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

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