結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-31 05:05:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 941 ms |
| コンパイル使用メモリ | 93,464 KB |
| 最終ジャッジ日時 | 2025-01-10 19:57:38 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 5 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <numeric>
#include <math.h>
#include <map>
using namespace std;
typedef long long int ll;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int q; cin >> q;
while(q--){
ll n,k; cin >> n >> k;
if(k==1){
cout << n-1 << endl;
continue;
}
ll res=0;
ll d=k;
while((d-1)<n*(k-1)){
res++;
d*=k;
}
cout << res << endl;
}
}