結果

問題 No.915 Plus Or Multiple Operation
ユーザー Rubikun
提出日時 2019-10-25 21:28:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 474 bytes
コンパイル時間 1,585 ms
コンパイル使用メモリ 165,976 KB
実行使用メモリ 16,840 KB
最終ジャッジ日時 2024-11-07 03:20:30
合計ジャッジ時間 8,045 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100003,INF=1<<30;

int main(){

    int Q;cin>>Q;
    while(Q){
        ll A,B,C;cin>>A>>B>>C;
        int cnt=0;
        while(A){
            if(A%C){
                A-=A%C;
                cnt++;
            }else{
                A/=C;
                cnt++;
            }
        }
        cout<<cnt<<endl;
        Q--;
    }
    
}

0