結果
問題 | No.897 compαctree |
ユーザー | mmn15277198 |
提出日時 | 2021-01-21 21:29:05 |
言語 | C++14 (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 613 ms |
コンパイル使用メモリ | 73,408 KB |
実行使用メモリ | 8,760 KB |
最終ジャッジ日時 | 2023-08-26 09:22:44 |
合計ジャッジ時間 | 4,055 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,380 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | TLE | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
ソースコード
#include <iostream> #include <vector> #include <math.h> using namespace std; using ll = long long; vector<int> ans; void solve(int n , int k){ int now = 0 , x = 1; for(int i = 0; ;i++){ if(i >= 1)x *= k; now += x; if(now >= n){ ans.push_back(i); return; } } } int main(){ int q; cin >> q; while(q--){ int n , k; cin >> n >> k; solve(n , k); } for(int i = 0; i < ans.size(); i++){ cout << ans[i] << endl; } return 0; }