結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-01-21 21:26:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 778 ms |
| コンパイル使用メモリ | 73,836 KB |
| 実行使用メモリ | 14,080 KB |
| 最終ジャッジ日時 | 2024-12-25 03:37:59 |
| 合計ジャッジ時間 | 40,439 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | TLE * 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;
for(int i = 0; ;i++){
now += pow(k , i);
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;
}
mmn15277198