結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
trineutron
|
| 提出日時 | 2019-10-05 00:39:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 378 bytes |
| コンパイル時間 | 1,633 ms |
| コンパイル使用メモリ | 165,460 KB |
| 実行使用メモリ | 8,448 KB |
| 最終ジャッジ日時 | 2024-10-04 00:58:00 |
| 合計ジャッジ時間 | 5,083 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 3 TLE * 1 -- * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int depth(int n, int k) {
if (k == 1) return n - 1;
int s = 1, p = k, d = 0;
while (s < n) {
s += p;
p *= k;
d++;
}
return d;
}
int main() {
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int n, k;
cin >> n >> k;
cout << depth(n, k) << endl;
}
}
trineutron