結果

問題 No.897 compαctree
ユーザー joybeeeejoybeeee
提出日時 2020-05-15 21:34:38
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 410 bytes
コンパイル時間 3,976 ms
コンパイル使用メモリ 73,956 KB
実行使用メモリ 57,648 KB
最終ジャッジ日時 2023-10-19 12:47:15
合計ジャッジ時間 7,971 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
55,376 KB
testcase_01 AC 144 ms
57,516 KB
testcase_02 AC 144 ms
57,504 KB
testcase_03 AC 146 ms
57,500 KB
testcase_04 AC 145 ms
57,648 KB
testcase_05 AC 147 ms
57,512 KB
testcase_06 AC 145 ms
57,504 KB
testcase_07 AC 144 ms
57,640 KB
testcase_08 AC 144 ms
57,220 KB
testcase_09 AC 145 ms
57,484 KB
testcase_10 AC 145 ms
57,540 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int q = sc.nextInt();
      while(q-- > 0) {
        int n = sc.nextInt();
        long k = sc.nextInt();
        int d = 0;
        while(n > 0) {
          n -= Math.pow(k, d);
          if(n <= 0) break;
          d++;
        }
        System.out.println(d);
      }
  }
}
0