結果

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

ソースコード

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) {
			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