結果

問題 No.897 compαctree
ユーザー ninoinui
提出日時 2020-01-26 02:01:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 242 bytes
コンパイル時間 1,614 ms
コンパイル使用メモリ 165,304 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 04:21:29
合計ジャッジ時間 5,219 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 0, n, k; i < N && cin >> n >> k; i++) {
    long tmp = 1, ans = 0;
    while (n > tmp && ++ans) tmp += pow(k, ans);
    cout << ans << "\n";
  }
}
0