結果

問題 No.897 compαctree
ユーザー lice6613
提出日時 2019-12-12 20:11:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 69,528 KB
実行使用メモリ 13,752 KB
最終ジャッジ日時 2024-06-25 14:16:19
合計ジャッジ時間 4,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 3 TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
  int Q;
  cin >> Q;
  vector<int> N(Q), K(Q);
  for (int i = 0; i < Q; ++i)
    cin >> N[i] >> K[i];
  for (int i = 0; i < Q; ++i) {
    int ans = 0, v = 1, p = 1;
    while (v < N[i])
      ++ans, p *= K[i], v += p;
    cout << ans << endl;
  }
}
0