結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-25 09:59:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 507 bytes |
| コンパイル時間 | 740 ms |
| コンパイル使用メモリ | 89,184 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 06:19:15 |
| 合計ジャッジ時間 | 1,390 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 WA * 3 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <cmath>
#include <map>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
using ll = long long;
ll q, n, k;
int main() {
cin.tie(0); ios_base::sync_with_stdio(false);
cin >> q;
REP(i, q) {
cin >> n >> k;
if(k == 1) cout << n-1;
else {
ll ans = 0, h = 1;
while(h < n) {
h *= k;
++ans;
}
cout << ans << '\n';
}
}
return 0;
}