結果

問題 No.897 compαctree
ユーザー 👑 hitonanodehitonanode
提出日時 2019-10-22 21:16:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 378 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 162,820 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-18 02:25:38
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)

int main()
{
    lint Q, N, K;
    cin >> Q;
    REP(_, Q)
    {
        cin >> N >> K;
        lint ret = 0, a = 1;
        while (a < N) ret++, a = a * K + 1;
        cout << ret << endl;
    }
}
0