結果
| 問題 | No.897 compαctree |
| コンテスト | |
| ユーザー |
keisuke6
|
| 提出日時 | 2022-07-12 14:35:41 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 2,083 ms |
| コンパイル使用メモリ | 333,424 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-08 06:08:51 |
| 合計ジャッジ時間 | 2,371 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int Q;
cin>>Q;
for(int i=0;i<Q;i++){
int a,b;
cin>>a>>b;
if(b == 1){
cout<<a-1<<endl;
continue;
}
int now = b;
int ans = 1;
int sum = 1;
while(sum < a){
sum += now;
ans++;
now *= b;
}
cout<<ans-1<<endl;
}
}
keisuke6