結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
12,032 KB
testcase_01 AC 85 ms
12,288 KB
testcase_02 AC 86 ms
12,288 KB
testcase_03 AC 89 ms
12,288 KB
testcase_04 AC 83 ms
12,288 KB
testcase_05 AC 83 ms
12,288 KB
testcase_06 AC 85 ms
12,032 KB
testcase_07 AC 84 ms
12,032 KB
testcase_08 AC 84 ms
12,288 KB
testcase_09 AC 85 ms
12,288 KB
testcase_10 WA -
testcase_11 AC 84 ms
12,160 KB
testcase_12 AC 84 ms
12,160 KB
testcase_13 AC 85 ms
12,160 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 99 ms
12,160 KB
testcase_17 AC 98 ms
12,288 KB
testcase_18 WA -
testcase_19 AC 84 ms
12,032 KB
testcase_20 AC 86 ms
12,032 KB
testcase_21 AC 89 ms
12,160 KB
testcase_22 AC 85 ms
12,288 KB
testcase_23 AC 86 ms
12,288 KB
testcase_24 AC 86 ms
12,160 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 85 ms
12,288 KB
testcase_28 AC 87 ms
12,160 KB
testcase_29 AC 90 ms
12,032 KB
testcase_30 AC 89 ms
12,032 KB
testcase_31 AC 90 ms
12,160 KB
testcase_32 AC 85 ms
12,032 KB
testcase_33 AC 84 ms
12,032 KB
testcase_34 AC 85 ms
12,160 KB
testcase_35 AC 83 ms
12,416 KB
testcase_36 AC 84 ms
12,160 KB
testcase_37 AC 82 ms
12,032 KB
testcase_38 AC 82 ms
12,288 KB
testcase_39 AC 85 ms
12,032 KB
testcase_40 AC 85 ms
12,288 KB
testcase_41 AC 87 ms
12,032 KB
testcase_42 AC 86 ms
12,160 KB
testcase_43 AC 87 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
      _b = $`
      _a = $'
      v1 = $1
      v2 = $2
      v3 = $3
      v4 = $4
      ans += v3.to_i * 100 + v4.to_i * 11
      v2.gsub!(v4, "")
      v2.sub!(v3, "")
      s = _b + v1 + v2 + _a
      break;
    end
  end
  break unless z
end
puts ans
0