結果

問題 No.928 軽減税率?
ユーザー ks2m
提出日時 2019-11-22 23:43:19
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 2,036 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 54,448 KB
最終ジャッジ日時 2024-10-11 06:27:51
合計ジャッジ時間 8,278 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 10
権限があれば一括ダウンロードができます

ソースコード

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; 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