結果

問題 No.897 compαctree
ユーザー Izayoi_R_sakuraIzayoi_R_sakura
提出日時 2019-10-08 18:46:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 1,782 ms
コンパイル使用メモリ 163,836 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-25 01:07:50
合計ジャッジ時間 5,373 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std ;

int main()
{
    int q , answer , cut ;
    cin >> q ;
    vector<int> n(q) ;
    vector<int> k(q) ;
    for(int i=0; i<q; i++)
        cin >> n.at(i) >> k.at(i) ;
    for(int i=0; i<q; i++)
    {
        answer = 0 ;
        cut = 1 ;
        while(n.at(i)>0)
        {
            answer++ ;
            n.at(i) -= cut ;
            cut *= k.at(i) ;
        }
        cout << answer-1 << endl ;
    }
}
0