結果

問題 No.928 軽減税率?
ユーザー ks2mks2m
提出日時 2019-11-22 23:42:32
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 74,204 KB
実行使用メモリ 54,496 KB
最終ジャッジ日時 2024-10-11 06:28:07
合計ジャッジ時間 8,065 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 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