結果

問題 No.897 compαctree
ユーザー bal4ubal4u
提出日時 2019-10-05 06:31:54
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 298 bytes
コンパイル時間 1,579 ms
コンパイル使用メモリ 27,296 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-07-27 19:04:35
合計ジャッジ時間 5,614 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

// yukicoder: No.897 compαctree
// 2019.10.5 bal4u

#include <stdio.h>

typedef long long ll;

int main()
{
	int N, K, Q, ans;
	ll k, s;

	scanf("%d", &Q); while (Q--) {
		scanf("%d%d", &N, &K);
		s = 1, k = 1, ans = 0;
		while (s < N) k *= K, s += k, ans++;
		printf("%d\n", ans);
	}
	return 0;
}
0