結果

問題 No.897 compαctree
ユーザー _____TAB__________TAB_____
提出日時 2019-10-04 21:25:52
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 238 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 69,848 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-14 10:11:09
合計ジャッジ時間 4,400 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  int Q;
  cin >> Q;
  while(Q--){
    long long N, K;
    cin >> N >> K;
    long long t = 1, ans = 0;
    --N;
    while(N > 0) t *= K, N -= t, ++ans;
    cout << ans << endl;
  }
}
0