結果

問題 No.928 軽減税率?
ユーザー lam6er
提出日時 2025-03-20 18:50:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 943 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 54,148 KB
最終ジャッジ日時 2025-03-20 18:52:32
合計ジャッジ時間 2,686 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

count = 0

for r in range(100):
    # Compute s_p and s_q
    sp = (r * (100 + P)) // 100
    sq = (r * (100 + Q)) // 100
    C = sq - sp + A

    # Determine m_min based on r
    m_min = 1 if r == 0 else 0
    m_max_x = (10**9 - r) // 100

    if m_max_x < m_min:
        continue  # No valid m for this r

    if P > Q:
        denominator = P - Q
        if C < 0:
            continue
        else:
            max_m_theoretical = (C - 1) // denominator
            max_m_upper = min(max_m_theoretical, m_max_x)
            if max_m_upper < m_min:
                continue
            num_m = max_m_upper - m_min + 1
            count += max(0, num_m)
    elif P == Q:
        if A <= 0:
            continue
        num_m = m_max_x - m_min + 1
        count += max(0, num_m)
    else:  # P < Q
        if C >= 0:
            num_m = m_max_x - m_min + 1
            count += max(0, num_m)

print(count)
0