結果

問題 No.897 compαctree
ユーザー Izayoi_R_sakuraIzayoi_R_sakura
提出日時 2019-10-08 18:46:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 1,521 ms
コンパイル使用メモリ 167,984 KB
実行使用メモリ 13,632 KB
最終ジャッジ日時 2024-11-07 10:34:33
合計ジャッジ時間 5,114 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 10 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

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