結果
問題 | No.1842 Decimal Point |
ユーザー |
![]() |
提出日時 | 2022-02-18 22:05:35 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 692 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 82,724 KB |
実行使用メモリ | 79,080 KB |
最終ジャッジ日時 | 2024-06-29 08:59:05 |
合計ジャッジ時間 | 1,492 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 3 |
ソースコード
mod = 1000000007eps = 10**-9def main():import sysimport mathinput = sys.stdin.readlineinv = {1: 1, 3: 7, 7: 3, 9: 9}for _ in range(int(input())):a, b, c = map(int, input().split())q = pow(10, c, b)cnt2 = cnt5 = 0while b % 2 == 0:cnt2 += 1b //= 2q //= 2while b % 5 == 0:cnt5 += 1b //= 5q //= 5r = (pow(2, c - cnt2, 10) * pow(5, c - cnt5, 10)) % 10p = ((r-q) * inv[b % 10]) % 10ans0 = (a * p) % 10ans1 = math.floor(a * q / b) % 10print((ans0 + ans1) % 10)if __name__ == '__main__':main()