結果

問題 No.928 軽減税率?
ユーザー ks2mks2m
提出日時 2019-11-22 23:43:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 2,664 ms
コンパイル使用メモリ 74,100 KB
実行使用メモリ 41,972 KB
最終ジャッジ日時 2024-04-19 14:00:05
合計ジャッジ時間 6,788 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
41,440 KB
testcase_01 AC 102 ms
41,172 KB
testcase_02 AC 96 ms
41,380 KB
testcase_03 AC 108 ms
41,360 KB
testcase_04 AC 117 ms
41,352 KB
testcase_05 AC 121 ms
41,404 KB
testcase_06 AC 119 ms
41,332 KB
testcase_07 AC 133 ms
41,604 KB
testcase_08 AC 131 ms
41,408 KB
testcase_09 AC 141 ms
41,420 KB
testcase_10 AC 111 ms
41,420 KB
testcase_11 AC 115 ms
41,328 KB
testcase_12 AC 116 ms
41,240 KB
testcase_13 AC 125 ms
41,432 KB
testcase_14 AC 125 ms
41,704 KB
testcase_15 AC 121 ms
41,372 KB
testcase_16 AC 126 ms
41,972 KB
testcase_17 AC 126 ms
40,680 KB
testcase_18 AC 124 ms
41,212 KB
testcase_19 AC 124 ms
41,820 KB
testcase_20 AC 118 ms
41,612 KB
testcase_21 AC 134 ms
40,680 KB
testcase_22 AC 112 ms
41,832 KB
testcase_23 AC 108 ms
41,772 KB
testcase_24 AC 112 ms
41,176 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 103 ms
40,356 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 ans = 0;
			for (int i = 100 * a + 2; 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