結果

問題 No.897 compαctree
ユーザー mmn15277198mmn15277198
提出日時 2021-01-21 21:26:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 431 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 72,616 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-08-26 09:20:43
合計ジャッジ時間 4,034 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,032 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0