結果
問題 | No.897 compαctree |
ユーザー |
![]() |
提出日時 | 2020-04-03 15:18:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 350 bytes |
コンパイル時間 | 1,498 ms |
コンパイル使用メモリ | 165,128 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 00:44:26 |
合計ジャッジ時間 | 2,180 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int q; cin >> q; while (q--) { ll n, k; cin >> n >> k; if (k == 1) { cout << n - 1 << '\n'; } else { ll cur = 1; int ans = 0; while (cur < n) { cur *= k; ans++; } cout << ans << '\n'; } } return 0; }