結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
season1618
|
| 提出日時 | 2019-10-04 21:46:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 486 bytes |
| コンパイル時間 | 1,273 ms |
| コンパイル使用メモリ | 158,484 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-03 07:24:39 |
| 合計ジャッジ時間 | 1,544 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 10 WA * 3 |
ソースコード
#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<<endl; continue; }
int j=1;long temp=K;
while(N-1>temp){
temp*=K;
j++;
}cout<<j<<endl;
}
}
season1618