結果

問題 No.1842 Decimal Point
コンテスト
ユーザー vjudge1
提出日時 2025-10-24 16:10:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 1,613 ms
コンパイル使用メモリ 162,704 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-24 16:11:02
合計ジャッジ時間 3,417 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#define int long long

int p,t;

int qpow(int a,int b,const int &p){
    int ans=1;
    while(b){
        if(b&1)
            ans=ans*a%p;
        a=a*a%p;
        b>>=1;
    }
    return ans;
}

signed main(){
    ios::sync_with_stdio(0);
    cin>>t;
    while(t--){
        int a,b,c,d;
        cin>>a>>b>>d;
        c=10;
        a=a%b;
        cout<<a*qpow(c,d-1,b)%b*c/b<<'\n';
    }
    cout<<flush;
    return 0;
}
0