結果
| 問題 |
No.897 compαctree
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-12 01:20:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 361 bytes |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 64,732 KB |
| 実行使用メモリ | 13,636 KB |
| 最終ジャッジ日時 | 2024-11-26 01:50:44 |
| 合計ジャッジ時間 | 4,097 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 WA * 9 TLE * 1 |
コンパイルメッセージ
main.cpp:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
main()
{
int Q;cin>>Q;
for(;Q--;)
{
int N,K;
cin>>N>>K;
if(K==1)cout<<N-1<<endl;
else
{
int T=1,cnt=0;long X=1;
while(T<N)
{
T+=X*=K;
cnt++;
}
cout<<cnt<<endl;
}
}
}