結果
問題 | No.1842 Decimal Point |
ユーザー |
![]() |
提出日時 | 2022-02-19 11:31:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 278 ms / 2,000 ms |
コード長 | 511 bytes |
コンパイル時間 | 1,425 ms |
コンパイル使用メモリ | 166,416 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-29 10:21:48 |
合計ジャッジ時間 | 2,808 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll =long long; #define all(v) v.begin(),v.end() #define rep(i,a,b) for(int i=a;i<b;i++) #define rrep(i,a,b) for(int i=a;i>=b;i--) ll mod_pow(ll x,ll n,ll mod) { ll res=1; while(n>0) { if(n&1) { res=res*x%mod; } x=x*x%mod; n>>=1; } return res; } void solve() { ll A,B,C;cin>>A>>B>>C; A%=B; ll t=mod_pow(10,C-1,B); ll ans=(A*t)%B; cout<<ans*10/B<<endl; } int main() { ll t;cin>>t; for(ll i=0;i<t;i++) { solve(); } }