結果
| 問題 | 
                            No.897 compαctree
                             | 
                    
| コンテスト | |
| ユーザー | 
                             _____TAB_____
                         | 
                    
| 提出日時 | 2019-10-04 21:25:52 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 238 bytes | 
| コンパイル時間 | 767 ms | 
| コンパイル使用メモリ | 66,548 KB | 
| 最終ジャッジ日時 | 2025-01-07 20:21:13 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 10 TLE * 3 | 
ソースコード
#include <iostream>
using namespace std;
int main(){
  int Q;
  cin >> Q;
  while(Q--){
    long long N, K;
    cin >> N >> K;
    long long t = 1, ans = 0;
    --N;
    while(N > 0) t *= K, N -= t, ++ans;
    cout << ans << endl;
  }
}
            
            
            
        
            
_____TAB_____