結果

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

ソースコード

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++) {
    int tmp = 1, ans = 0;
    while (n > tmp && ++ans) tmp += pow(k, ans);
    cout << ans << "\n";
  }
}
0