結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
moririn2528_c
|
| 提出日時 | 2019-10-05 11:43:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 825 bytes |
| コンパイル時間 | 841 ms |
| コンパイル使用メモリ | 91,844 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-10-05 11:27:04 |
| 合計ジャッジ時間 | 4,395 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 3 TLE * 1 -- * 9 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;
void array_show(int *array,int array_n,char middle=' '){
for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
int main(){
int n,m,t;
int i,j,k;
int a,b,c;
cin>>t;
while(t--){
cin>>n>>m;
if(m==1){
cout<<n-1<<endl;
continue;
}
a=1,b=0,c=1;
while(a<n){
c*=m,a+=c,b++;
}
cout<<b<<endl;
}
}
moririn2528_c