結果

問題 No.825 賢いお買い物
ユーザー koba-e964koba-e964
提出日時 2019-05-03 22:49:23
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 278 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-08-30 06:32:06
合計ジャッジ時間 3,083 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 82 ms
15,136 KB
testcase_03 AC 81 ms
15,160 KB
testcase_04 AC 82 ms
15,312 KB
testcase_05 AC 80 ms
15,036 KB
testcase_06 AC 80 ms
15,044 KB
testcase_07 AC 79 ms
15,176 KB
testcase_08 WA -
testcase_09 AC 79 ms
15,148 KB
testcase_10 AC 81 ms
15,128 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 82 ms
15,176 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 85 ms
15,144 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a,b,c = gets.split.map &:to_i
for i in 0..a
  for j in 0..b
    if i + j == 0; next; end
    for k in 0..i + 10 * j
      l = (k / 10) + (k % 10)
      if c == l + (a - i) + (b - j)
        puts i + 10 * j - k
        exit 0
      end
    end
  end
end
puts 'Impossible'
      
0