結果

問題 No.928 軽減税率?
ユーザー ks2mks2m
提出日時 2019-11-22 23:46:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 809 bytes
コンパイル時間 1,849 ms
コンパイル使用メモリ 77,632 KB
実行使用メモリ 54,528 KB
最終ジャッジ日時 2024-04-19 14:00:40
合計ジャッジ時間 6,989 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
40,060 KB
testcase_01 AC 98 ms
41,464 KB
testcase_02 AC 120 ms
41,540 KB
testcase_03 AC 125 ms
41,408 KB
testcase_04 AC 126 ms
41,688 KB
testcase_05 AC 123 ms
41,296 KB
testcase_06 AC 105 ms
41,616 KB
testcase_07 AC 112 ms
41,204 KB
testcase_08 AC 108 ms
40,528 KB
testcase_09 AC 124 ms
41,472 KB
testcase_10 AC 126 ms
41,440 KB
testcase_11 AC 122 ms
41,452 KB
testcase_12 AC 123 ms
41,324 KB
testcase_13 AC 111 ms
41,516 KB
testcase_14 AC 121 ms
40,856 KB
testcase_15 AC 113 ms
41,344 KB
testcase_16 AC 124 ms
41,532 KB
testcase_17 AC 124 ms
41,428 KB
testcase_18 AC 119 ms
41,508 KB
testcase_19 AC 119 ms
41,060 KB
testcase_20 AC 119 ms
41,608 KB
testcase_21 AC 117 ms
41,564 KB
testcase_22 AC 108 ms
41,608 KB
testcase_23 AC 112 ms
41,148 KB
testcase_24 AC 118 ms
40,416 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 105 ms
41,300 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 112 ms
40,108 KB
testcase_33 AC 115 ms
41,180 KB
testcase_34 AC 114 ms
41,268 KB
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 {
				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(1000000000 - (100 * a + 2) + ans);
			}
		} 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