結果
問題 |
No.897 compαctree
|
ユーザー |
![]() |
提出日時 | 2023-08-23 13:28:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 581 bytes |
コンパイル時間 | 797 ms |
コンパイル使用メモリ | 99,636 KB |
最終ジャッジ日時 | 2025-02-16 12:32:08 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++){ long long n, k; cin >> n >> k; if (n <= k) cout << 1 << endl; else if (k == 1) cout << n - 1 << endl; else { for (int j = 2; j < 32; j++){ if (pow(k, j) >= n){ cout << j << endl; break; } } } } }