結果

問題 No.928 軽減税率?
ユーザー ks2m
提出日時 2019-11-22 23:49:30
言語 Java
(openjdk 23)
結果
AC  
実行時間 152 ms / 1,000 ms
コード長 613 bytes
コンパイル時間 2,109 ms
コンパイル使用メモリ 74,452 KB
実行使用メモリ 41,796 KB
最終ジャッジ日時 2024-10-11 06:29:30
合計ジャッジ時間 8,207 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

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 (a == 0 && p == q) {
			System.out.println(0);
			return;
		}

		int max = 100 * (a + 1);
		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++;
			}
		}
		if (p <= q) {
			System.out.println(1000000000 - max + ans);
		} else {
			System.out.println(ans);
		}
	}
}
0