結果
| 問題 | No.897 compαctree |
| コンテスト | |
| ユーザー |
ate
|
| 提出日時 | 2019-11-06 13:55:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 398 bytes |
| 記録 | |
| コンパイル時間 | 1,300 ms |
| コンパイル使用メモリ | 210,928 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-08 03:00:18 |
| 合計ジャッジ時間 | 2,490 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);++i)
main(){
ll q;
cin>>q;
vector<ll> n(q),k(q);
rep(i,q)cin>>n[i]>>k[i];
auto solve = [](ll n,ll k){
if(k==1)return n-1;
n--;
ll cnt=0,leaf=1;
while(leaf<n){
cnt++;
leaf*=k;
}
return cnt;
};
rep(i,q){
cout<<(solve(n[i],k[i]))<<endl;
}
}
ate