結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-13 13:49:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 284 bytes |
| コンパイル時間 | 2,423 ms |
| コンパイル使用メモリ | 190,356 KB |
| 最終ジャッジ日時 | 2025-01-09 17:59:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 TLE * 3 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
int q; cin>>q;
rep(_,q){
lint n,k; cin>>n>>k;
lint sum=1;
int ans=0;
while(sum<n){
sum=k*sum+1;
ans++;
}
printf("%d\n",ans);
}
return 0;
}