結果
| 問題 |
No.1842 Decimal Point
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-18 22:14:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 124 ms / 2,000 ms |
| コード長 | 1,433 bytes |
| コンパイル時間 | 670 ms |
| コンパイル使用メモリ | 99,208 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 09:05:43 |
| 合計ジャッジ時間 | 1,542 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 |
ソースコード
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
Int mul(Int a, Int b, Int m) {
return ((__int128)(a) * b) % m;
}
Int power(Int a, Int e, Int m) {
Int x = a % m, y = 1 % m;
for (; e; e >>= 1) {
if (e & 1) y = mul(y, x, m);
x = mul(x, x, m);
}
return y;
}
int main() {
for (int numCases; ~scanf("%d", &numCases); ) for (int caseId = 1; caseId <= numCases; ++caseId) {
Int A, B, C;
scanf("%lld%lld%lld", &A, &B, &C);
Int t = power(10LL, C, 10LL * B);
t = mul(t, A, 10LL * B);
printf("%lld\n", t / B);
}
return 0;
}