結果

問題 No.437 cwwゲーム
ユーザー char134217728char134217728
提出日時 2017-08-20 14:21:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-22 18:13:43
合計ジャッジ時間 4,571 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
12,160 KB
testcase_01 AC 87 ms
12,032 KB
testcase_02 AC 79 ms
12,032 KB
testcase_03 AC 80 ms
12,160 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 78 ms
12,032 KB
testcase_12 AC 82 ms
12,032 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 78 ms
12,288 KB
testcase_17 AC 79 ms
12,032 KB
testcase_18 WA -
testcase_19 AC 80 ms
12,160 KB
testcase_20 AC 79 ms
12,032 KB
testcase_21 AC 78 ms
12,032 KB
testcase_22 AC 78 ms
12,032 KB
testcase_23 AC 77 ms
12,032 KB
testcase_24 AC 78 ms
12,032 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 76 ms
12,160 KB
testcase_28 AC 79 ms
12,032 KB
testcase_29 AC 75 ms
12,032 KB
testcase_30 AC 77 ms
12,288 KB
testcase_31 AC 82 ms
12,160 KB
testcase_32 AC 79 ms
12,288 KB
testcase_33 WA -
testcase_34 AC 82 ms
12,032 KB
testcase_35 AC 81 ms
12,032 KB
testcase_36 AC 79 ms
12,288 KB
testcase_37 AC 75 ms
12,160 KB
testcase_38 AC 78 ms
12,160 KB
testcase_39 AC 82 ms
12,032 KB
testcase_40 AC 77 ms
12,288 KB
testcase_41 WA -
testcase_42 AC 84 ms
12,288 KB
testcase_43 AC 78 ms
12,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
rl = []
[*1..9].reverse.each do |i|
  [*0..9].reverse.each do |j|
    next if i == j
    rl << Regexp.new("(#{i}).*(#{j}).*#{j}")
  end
end
ans = 0
while true do
  z = false
  rl.each do |i|
    if s =~ i
      z = true
      _s = $&
      _b = $`
      _a = $'
      v1 = $1
      v2 = $2
      ans += v1.to_i * 100 + v2.to_i * 11
      _s.gsub!(v2, "")
      _s.sub!(v1, "")
      s = _b + _s + _a
      break;
    end
  end
  break unless z
end
puts ans
0