結果

問題 No.897 compαctree
ユーザー toyamatoyama
提出日時 2019-10-04 21:32:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 1,551 ms
コンパイル使用メモリ 82,936 KB
実行使用メモリ 10,272 KB
最終ジャッジ日時 2024-04-14 10:18:29
合計ジャッジ時間 4,964 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,272 KB
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 #

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
template<class T, class Compare = less<T> >
using MaxHeap = priority_queue<T, vector<T>, Compare>;
template<class T, class Compare = greater<T> >
using MinHeap = priority_queue<T, vector<T>, Compare>;
using llong = long long;

llong tmpn, tmpk;
__int128_t n, k;

int main() {
    llong q;
    cin >> q;

    while (q--) {
        cin >> tmpn >> tmpk;
        n = tmpn;
        k = tmpk;

        __int128_t d = 1;
        __int128_t x = 1;
        llong cnt = 0;
        while (x < n) {
            x += d;
            d *= k;
            cnt++;
        }

        cout << cnt << endl;
    }

    return 0;
}
0