結果

問題 No.928 軽減税率?
ユーザー ks2mks2m
提出日時 2019-11-22 23:42:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 74,076 KB
実行使用メモリ 56,004 KB
最終ジャッジ日時 2024-04-19 13:59:55
合計ジャッジ時間 6,902 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
39,896 KB
testcase_01 AC 120 ms
40,952 KB
testcase_02 AC 118 ms
40,916 KB
testcase_03 AC 106 ms
41,256 KB
testcase_04 AC 116 ms
39,780 KB
testcase_05 AC 120 ms
41,004 KB
testcase_06 AC 126 ms
41,464 KB
testcase_07 AC 115 ms
41,156 KB
testcase_08 AC 121 ms
41,180 KB
testcase_09 AC 119 ms
41,276 KB
testcase_10 AC 116 ms
41,488 KB
testcase_11 AC 119 ms
41,112 KB
testcase_12 AC 117 ms
41,196 KB
testcase_13 AC 110 ms
41,416 KB
testcase_14 AC 112 ms
41,012 KB
testcase_15 AC 115 ms
41,376 KB
testcase_16 AC 113 ms
41,080 KB
testcase_17 AC 121 ms
41,060 KB
testcase_18 AC 109 ms
41,512 KB
testcase_19 AC 123 ms
41,864 KB
testcase_20 AC 126 ms
40,184 KB
testcase_21 AC 126 ms
40,412 KB
testcase_22 AC 116 ms
40,876 KB
testcase_23 AC 105 ms
41,252 KB
testcase_24 AC 107 ms
41,252 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 110 ms
40,940 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		double p = sc.nextInt();
		double q = sc.nextInt();
		int a = sc.nextInt();
		sc.close();

		if (p <= q) {
			if (a == 0 && p == q) {
				System.out.println(0);
			} else {
				System.out.println(1000000000);
			}
		} else {
			int max = (int) (100 * a / (p - q));
			int ans = 0;
			for (int i = max; i > 0; i--) {
				int x = (int) ((100 + p) * i / 100);
				int y = (int) ((100 + q) * i / 100);
				if (x < y + a) {
					ans++;
				}
			}
			System.out.println(ans);
		}
	}
}
0