結果

問題 No.928 軽減税率?
ユーザー yuruhiyayuruhiya
提出日時 2020-07-06 22:56:00
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 23,550 ms
コンパイル使用メモリ 254,120 KB
実行使用メモリ 4,560 KB
最終ジャッジ日時 2023-09-13 11:06:45
合計ジャッジ時間 18,766 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,488 KB
testcase_01 AC 2 ms
4,408 KB
testcase_02 AC 5 ms
4,376 KB
testcase_03 AC 3 ms
4,396 KB
testcase_04 AC 3 ms
4,388 KB
testcase_05 AC 4 ms
4,476 KB
testcase_06 AC 4 ms
4,472 KB
testcase_07 AC 5 ms
4,376 KB
testcase_08 AC 5 ms
4,472 KB
testcase_09 AC 5 ms
4,508 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 4 ms
4,528 KB
testcase_12 AC 6 ms
4,404 KB
testcase_13 AC 4 ms
4,468 KB
testcase_14 AC 6 ms
4,432 KB
testcase_15 AC 4 ms
4,400 KB
testcase_16 AC 5 ms
4,392 KB
testcase_17 AC 6 ms
4,404 KB
testcase_18 AC 6 ms
4,376 KB
testcase_19 AC 6 ms
4,436 KB
testcase_20 AC 6 ms
4,504 KB
testcase_21 AC 6 ms
4,472 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 6 ms
4,544 KB
testcase_25 AC 3 ms
4,448 KB
testcase_26 AC 3 ms
4,512 KB
testcase_27 AC 3 ms
4,540 KB
testcase_28 AC 3 ms
4,448 KB
testcase_29 AC 2 ms
4,384 KB
testcase_30 AC 2 ms
4,404 KB
testcase_31 AC 2 ms
4,560 KB
testcase_32 WA -
testcase_33 AC 2 ms
4,448 KB
testcase_34 AC 2 ms
4,504 KB
testcase_35 AC 2 ms
4,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MAX_C = 10 ** 9
x, y, a = read_line.split.map &.to_i
check = ->(i : Int32) {
  x * i // 100 < y * i // 100 + a
}
if x == y
  puts a == 0 ? MAX_C : 0
else
  limit = (a + 1) * 100
  puts (1..limit).count { |i| check.call(i) } + (check.call(limit + 1) ? 1 : 0) * (MAX_C - limit)
end
0