結果

問題 No.928 軽減税率?
ユーザー tamatotamato
提出日時 2019-11-22 22:48:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 760 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 54,528 KB
最終ジャッジ日時 2024-04-19 12:10:07
合計ジャッジ時間 2,190 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
52,588 KB
testcase_01 AC 31 ms
53,176 KB
testcase_02 AC 31 ms
52,872 KB
testcase_03 AC 32 ms
52,628 KB
testcase_04 AC 32 ms
52,392 KB
testcase_05 AC 32 ms
53,368 KB
testcase_06 AC 32 ms
53,068 KB
testcase_07 AC 33 ms
52,396 KB
testcase_08 AC 32 ms
52,332 KB
testcase_09 AC 33 ms
53,268 KB
testcase_10 AC 33 ms
53,816 KB
testcase_11 AC 32 ms
52,384 KB
testcase_12 AC 31 ms
53,084 KB
testcase_13 AC 32 ms
52,648 KB
testcase_14 AC 31 ms
52,928 KB
testcase_15 AC 33 ms
54,004 KB
testcase_16 AC 33 ms
52,256 KB
testcase_17 AC 32 ms
52,596 KB
testcase_18 AC 31 ms
53,600 KB
testcase_19 AC 32 ms
53,256 KB
testcase_20 AC 32 ms
52,576 KB
testcase_21 AC 32 ms
52,436 KB
testcase_22 AC 31 ms
53,140 KB
testcase_23 AC 32 ms
52,452 KB
testcase_24 AC 32 ms
52,748 KB
testcase_25 WA -
testcase_26 AC 33 ms
52,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 34 ms
53,968 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 32 ms
53,600 KB
testcase_33 AC 33 ms
52,656 KB
testcase_34 AC 31 ms
52,936 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor

P, Q, A = map(int, input().split())

if P == Q:
    if A > 0:
        print(10**9)
    else:
        print(0)
    exit()

if P < Q:
    if A > 0:
        print(10**9)
        exit()
    else:
        ng = 0
        for i in range(1, 101):
            if floor(P*i/100) == floor(Q*i/100):
                ng += 1
            else:
                print(10**9-ng)
                exit()

ans = 0
for mod in range(100):
    p = floor(P*mod/100)
    q = floor(Q*mod/100)
    k = (q - p + A) / (P - Q)
    if mod != 0:
        if floor(k) == k:
            ans += floor(k)
        else:
            ans += floor(k) + 1
    else:
        if floor(k) == k:
            ans += floor(k) - 1
        else:
            ans += floor(k)

print(ans)
0