結果
問題 |
No.897 compαctree
|
ユーザー |
![]() |
提出日時 | 2019-10-04 21:24:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 593 ms |
コンパイル使用メモリ | 73,340 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-10-03 07:08:44 |
合計ジャッジ時間 | 4,072 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 10 TLE * 1 -- * 2 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; using ll = long long; int main() { int q; cin >> q; for (int h = 0; h < q; h++) { int n, k; cin >> n >> k; ll s = 1, c = 1; for (int i = 0;; i++) { if (s >= n) { cout << i << endl; break; } c *= k; s += c; } } return 0; }