結果

問題 No.897 compαctree
ユーザー yakkiyakki
提出日時 2019-10-09 03:25:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 886 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 84,584 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-25 22:41:22
合計ジャッジ時間 4,448 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

int main(){
   int Q; cin >> Q;
   while(Q--){
       int N,K; cin >> N >> K;
       int ans = 0;
       if(K == 1) ans = N-1;
       else{
           int tmp = 1;
           while(true){
               if(tmp >= N) break;
               tmp *= K;
               ans++;
           }
       }
       cout << ans << endl;
   }

}
0