結果

問題 No.897 compαctree
ユーザー htensaihtensai
提出日時 2019-12-07 11:09:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 72,812 KB
実行使用メモリ 62,312 KB
最終ジャッジ日時 2023-08-26 05:26:48
合計ジャッジ時間 7,714 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
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();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < q; i++) {
		    sb.append(getCount(sc.nextInt(), sc.nextInt())).append("\n");
		}
		System.out.println(sb);
   }
   
   static int getCount(long n, int k) {
       int idx = 0;
       while (n > 0) {
           n -= (long)(Math.pow(k, idx));
           idx++;
       }
       return idx - 1;
   }
}

0