結果
問題 | No.1842 Decimal Point |
ユーザー |
![]() |
提出日時 | 2022-02-18 22:09:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 277 ms / 2,000 ms |
コード長 | 783 bytes |
コンパイル時間 | 3,152 ms |
コンパイル使用メモリ | 229,536 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 09:03:04 |
合計ジャッジ時間 | 4,659 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; //const long nPrime = 1000000007; //const long nPrime = 998244353; typedef long long ll; long LF_Pow(long nBase, long nExp, long nMod){ if(nExp < 0){ return -1; } long iTmp = nBase % nMod; long nReturn = 1; while (nExp > 0){ if(nExp % 2 == 1){ nReturn *= iTmp; nReturn %= nMod; } iTmp = iTmp * iTmp; iTmp %= nMod; nExp /= 2; } return nReturn; } int main() { long t; cin >> t; while(t--){ long a,b,c; cin >> a >> b >> c; long x = LF_Pow(10, c-1,b); x *= a; x %= b; x *= 10; cout << x/b << endl; } return 0; }