結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
12,160 KB
testcase_01 AC 91 ms
12,160 KB
testcase_02 AC 87 ms
12,160 KB
testcase_03 AC 85 ms
12,288 KB
testcase_04 AC 84 ms
12,288 KB
testcase_05 AC 82 ms
12,160 KB
testcase_06 AC 87 ms
12,288 KB
testcase_07 WA -
testcase_08 AC 86 ms
12,160 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 83 ms
12,032 KB
testcase_12 AC 83 ms
12,288 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 84 ms
12,288 KB
testcase_17 AC 84 ms
12,160 KB
testcase_18 WA -
testcase_19 AC 84 ms
12,160 KB
testcase_20 AC 82 ms
12,160 KB
testcase_21 AC 82 ms
12,160 KB
testcase_22 AC 82 ms
12,160 KB
testcase_23 AC 85 ms
12,288 KB
testcase_24 AC 85 ms
12,032 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 84 ms
12,160 KB
testcase_28 AC 87 ms
12,160 KB
testcase_29 AC 85 ms
12,288 KB
testcase_30 AC 87 ms
12,160 KB
testcase_31 AC 85 ms
12,032 KB
testcase_32 AC 87 ms
12,160 KB
testcase_33 AC 89 ms
12,160 KB
testcase_34 AC 86 ms
12,160 KB
testcase_35 AC 83 ms
12,160 KB
testcase_36 AC 83 ms
12,160 KB
testcase_37 AC 83 ms
12,288 KB
testcase_38 AC 84 ms
12,160 KB
testcase_39 AC 83 ms
12,160 KB
testcase_40 AC 82 ms
12,288 KB
testcase_41 WA -
testcase_42 AC 84 ms
12,160 KB
testcase_43 AC 85 ms
12,160 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