結果

問題 No.928 軽減税率?
ユーザー 37zigen37zigen
提出日時 2019-11-22 22:31:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 820 bytes
コンパイル時間 2,328 ms
コンパイル使用メモリ 76,904 KB
実行使用メモリ 41,552 KB
最終ジャッジ日時 2024-04-19 12:02:25
合計ジャッジ時間 6,780 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
41,172 KB
testcase_01 AC 103 ms
41,320 KB
testcase_02 AC 107 ms
41,024 KB
testcase_03 AC 100 ms
41,320 KB
testcase_04 AC 115 ms
41,016 KB
testcase_05 AC 112 ms
41,528 KB
testcase_06 AC 106 ms
41,180 KB
testcase_07 AC 117 ms
40,952 KB
testcase_08 AC 112 ms
41,244 KB
testcase_09 AC 101 ms
40,948 KB
testcase_10 AC 100 ms
40,656 KB
testcase_11 AC 109 ms
41,348 KB
testcase_12 AC 119 ms
39,884 KB
testcase_13 AC 117 ms
41,204 KB
testcase_14 AC 115 ms
41,552 KB
testcase_15 AC 117 ms
41,480 KB
testcase_16 AC 107 ms
41,352 KB
testcase_17 AC 107 ms
41,152 KB
testcase_18 AC 104 ms
41,140 KB
testcase_19 AC 110 ms
41,500 KB
testcase_20 AC 117 ms
41,068 KB
testcase_21 AC 109 ms
41,448 KB
testcase_22 WA -
testcase_23 AC 113 ms
41,216 KB
testcase_24 AC 107 ms
41,152 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

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();
        new Main().run(P, Q, A);
    }
    
    void run(long P, long Q, long A) {
        if (P < Q || (P == Q)) {
            System.out.println((long) 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