結果

問題 No.1842 Decimal Point
ユーザー ygd.ygd.
提出日時 2022-02-18 21:33:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 77,772 KB
最終ジャッジ日時 2023-09-11 18:37:28
合計ジャッジ時間 1,912 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,224 KB
testcase_01 AC 130 ms
77,420 KB
testcase_02 AC 236 ms
77,548 KB
testcase_03 AC 184 ms
77,760 KB
testcase_04 AC 189 ms
77,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]


def main():
    t = int(input())
    for _ in range(t):
        a,b,c = map(int,input().split())
        g = math.gcd(a,b)
        a //= g; b //= g
        ans = a * pow(10,c,b*10) //b
        print(ans%10)     
        

if __name__ == '__main__':
    main()
0