結果

問題 No.1842 Decimal Point
ユーザー AngrySadEightAngrySadEight
提出日時 2023-03-03 00:02:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 893 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 81,584 KB
実行使用メモリ 82,064 KB
最終ジャッジ日時 2023-10-17 19:19:56
合計ジャッジ時間 4,898 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,408 KB
testcase_01 AC 802 ms
82,064 KB
testcase_02 AC 893 ms
78,668 KB
testcase_03 AC 701 ms
77,636 KB
testcase_04 AC 592 ms
77,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def my_pow(x, n, mod):
    if n == 0:
        return 1
    elif n % 2 == 1:
        return (x * my_pow((x * x) % mod, n // 2, mod)) % mod
    else:
        return my_pow((x * x) % mod, n // 2, mod)

T = int(input())
for _ in range(T):
    A, B, C = map(int, input().split())
    rem = my_pow(10, C, 10 * B)
    rem = (A * rem) % (10 * B)
    print(rem // B)
0