結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
season1618
|
| 提出日時 | 2019-10-04 21:47:38 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 488 bytes |
| コンパイル時間 | 1,104 ms |
| コンパイル使用メモリ | 160,080 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-03 07:26:17 |
| 合計ジャッジ時間 | 1,618 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) a.begin(),a.end()
#define print(A,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i];}cout<<endl;
#define pprint(A,m,n) rep(j,0,m){print(A[j],n);}
const long mod=1e9+7;
const int size=1e6;
int main(){
int Q;cin>>Q;
long N,K;
rep(i,0,Q){
cin>>N>>K;
if(K==1){ cout<<N-1<<endl; continue; }
int j=1;long temp=K;
while(N-1>temp){
temp*=K;
j++;
}cout<<j<<endl;
}
}
season1618