結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-01-21 21:31:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 447 bytes |
| コンパイル時間 | 615 ms |
| コンパイル使用メモリ | 73,588 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-12-25 03:44:13 |
| 合計ジャッジ時間 | 10,343 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 TLE * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
using ll = long long;
vector<int> ans;
void solve(ll n , ll k){
ll 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--){
ll n , k;
cin >> n >> k;
solve(n , k);
}
for(int i = 0; i < ans.size(); i++){
cout << ans[i] << endl;
}
return 0;
}
mmn15277198