結果
| 問題 | No.897 compαctree |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-31 05:05:35 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| 記録 | |
| コンパイル時間 | 749 ms |
| コンパイル使用メモリ | 109,236 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-10 10:45:59 |
| 合計ジャッジ時間 | 1,510 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}