結果

問題 No.928 軽減税率?
ユーザー 37zigen37zigen
提出日時 2019-11-22 22:25:37
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 718 bytes
コンパイル時間 2,472 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-10-11 04:08:07
合計ジャッジ時間 8,575 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20 WA * 13 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;
import java.io.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        long P = sc.nextLong();
        long Q = sc.nextLong();
        long A = sc.nextLong();
        if (P < Q) {
            System.out.println(1e9);
            return;
        }
        if (A == 0) {
            System.out.println(0);
            return;
        }
        long ans = Math.max(0, (A - 1) * 100 / (P - Q) - 1);
        for (long x = Math.max(1, (A - 1) * 100 / (P - Q)); x <= (A + 1) * 100 / (P - Q); ++x) {
            if ((P + 100) * x / 100  < (Q + 100) * x / 100 + A ) ++ans;
        }
        System.out.println(ans);
    }
}
0