結果

問題 No.897 compαctree
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-02-07 04:13:18
言語 Ruby
(3.3.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 175 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,524 KB
実行使用メモリ 15,236 KB
最終ジャッジ日時 2023-09-18 13:22:06
合計ジャッジ時間 1,964 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,224 KB
testcase_01 AC 87 ms
15,088 KB
testcase_02 AC 79 ms
15,044 KB
testcase_03 AC 79 ms
15,196 KB
testcase_04 AC 79 ms
15,228 KB
testcase_05 AC 83 ms
15,040 KB
testcase_06 AC 79 ms
15,152 KB
testcase_07 AC 79 ms
15,152 KB
testcase_08 AC 78 ms
15,152 KB
testcase_09 AC 79 ms
15,156 KB
testcase_10 AC 78 ms
15,236 KB
testcase_11 AC 78 ms
15,144 KB
testcase_12 AC 79 ms
15,172 KB
testcase_13 AC 80 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets.to_i.times{
	a,b=gets.split(" ").map{|e| e.to_i}
	if b==1 then
		puts a-1
	else
		ans=0
		s1=1
		m1=1
		while s1<a do
			m1*=b
			s1+=m1
			ans+=1
		end
		puts ans
	end
}
0