結果

問題 No.338 アンケート機能
ユーザー wotsushiwotsushi
提出日時 2017-01-28 10:08:39
言語 Ruby
(3.3.0)
結果
AC  
実行時間 400 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 66,308 KB
最終ジャッジ日時 2023-08-25 13:00:35
合計ジャッジ時間 12,705 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 351 ms
66,288 KB
testcase_01 AC 369 ms
66,044 KB
testcase_02 AC 366 ms
66,068 KB
testcase_03 AC 362 ms
66,008 KB
testcase_04 AC 372 ms
66,012 KB
testcase_05 AC 363 ms
66,164 KB
testcase_06 AC 362 ms
66,112 KB
testcase_07 AC 365 ms
66,016 KB
testcase_08 AC 400 ms
66,212 KB
testcase_09 AC 335 ms
66,212 KB
testcase_10 AC 332 ms
66,116 KB
testcase_11 AC 375 ms
66,104 KB
testcase_12 AC 332 ms
66,256 KB
testcase_13 AC 366 ms
66,196 KB
testcase_14 AC 333 ms
66,024 KB
testcase_15 AC 330 ms
66,248 KB
testcase_16 AC 363 ms
66,104 KB
testcase_17 AC 332 ms
66,104 KB
testcase_18 AC 358 ms
66,024 KB
testcase_19 AC 332 ms
66,048 KB
testcase_20 AC 341 ms
66,208 KB
testcase_21 AC 362 ms
66,000 KB
testcase_22 AC 365 ms
66,240 KB
testcase_23 AC 360 ms
66,264 KB
testcase_24 AC 349 ms
66,096 KB
testcase_25 AC 333 ms
66,232 KB
testcase_26 AC 367 ms
66,308 KB
testcase_27 AC 362 ms
66,152 KB
testcase_28 AC 364 ms
66,244 KB
testcase_29 AC 367 ms
66,052 KB
testcase_30 AC 352 ms
66,240 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

A, B = gets.split.map(&:to_i)
ans = [*(0..1000)].product([*(0..1000)]).select {|a, b|
  (a + b) * (2 * A - 1) <= 200 * a and 200 * a < (a + b) * (2 * A + 1) and
  (a + b) * (2 * B - 1) <= 200 * b and 200 * b < (a + b) * (2 * B + 1)}.map {|(a, b)| a + b}.min
puts ans
0