結果
問題 |
No.897 compαctree
|
ユーザー |
|
提出日時 | 2020-07-13 22:32:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 297 bytes |
コンパイル時間 | 1,521 ms |
コンパイル使用メモリ | 165,420 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-08 11:00:17 |
合計ジャッジ時間 | 5,150 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 TLE * 1 -- * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) typedef long long ll; int main(){ int q; cin>>q; rep(j,q){ int n,k; cin>>n>>k; ll r=0; int i=0; int ans=0; while(1){ r+=pow(k,i); if(r<n) i++; else {ans=i; break;} } cout<<ans<<endl; } }