1
0

More than 1 year has passed since last update.

yukicoder contest 332 不参戦記

Posted at

yukicoder contest 332 不参戦記

A 1841 Long Long

Python だと乗算一発.

N = int(input())

print('Long' * N)

B 1842 Decimal Point

Aに10Cをかけて、Bで割った商を10で割ったあまりが答えだけど、10Cが大きすぎて計算できない. ここで10×BをBで割った商を10で割ったあまりが常に0になるという事実に気づくと計算可能になる.

T = int(input())

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0