結果

問題 No.437 cwwゲーム
ユーザー cielciel
提出日時 2016-11-03 02:11:48
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 15,404 KB
最終ジャッジ日時 2023-08-16 12:54:54
合計ジャッジ時間 7,550 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,152 KB
testcase_01 AC 82 ms
15,236 KB
testcase_02 WA -
testcase_03 AC 81 ms
15,136 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 177 ms
15,280 KB
testcase_08 AC 86 ms
15,292 KB
testcase_09 AC 177 ms
15,280 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 79 ms
15,156 KB
testcase_13 AC 81 ms
15,200 KB
testcase_14 AC 80 ms
15,132 KB
testcase_15 AC 196 ms
15,168 KB
testcase_16 AC 78 ms
15,124 KB
testcase_17 WA -
testcase_18 AC 81 ms
15,300 KB
testcase_19 WA -
testcase_20 AC 77 ms
15,264 KB
testcase_21 WA -
testcase_22 AC 78 ms
15,284 KB
testcase_23 AC 78 ms
15,112 KB
testcase_24 AC 77 ms
15,164 KB
testcase_25 AC 78 ms
15,244 KB
testcase_26 AC 78 ms
15,028 KB
testcase_27 AC 78 ms
15,116 KB
testcase_28 AC 78 ms
15,036 KB
testcase_29 AC 78 ms
15,244 KB
testcase_30 AC 78 ms
15,140 KB
testcase_31 AC 78 ms
15,052 KB
testcase_32 AC 79 ms
15,032 KB
testcase_33 AC 79 ms
15,184 KB
testcase_34 AC 77 ms
15,024 KB
testcase_35 AC 78 ms
15,168 KB
testcase_36 AC 79 ms
15,024 KB
testcase_37 AC 79 ms
15,028 KB
testcase_38 AC 80 ms
15,340 KB
testcase_39 AC 80 ms
15,300 KB
testcase_40 AC 79 ms
15,104 KB
testcase_41 AC 80 ms
15,300 KB
testcase_42 AC 79 ms
15,236 KB
testcase_43 AC 79 ms
15,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
def dfs(a)
	r=0
	0.upto(a.size-3){|i|
		next if a[i]=='0'
		(i+1).upto(a.size-2){|j|
			(j+1).upto(a.size-1){|k|
				if a[j]==a[k]
					b=a.dup
					[k,j,i].each{|e|b.delete_at(e)}
					r=[r,(a[i]+a[j]+a[k]).to_i+dfs(b)].max
				end
			}
		}
	}
	r
end
p dfs(gets.chomp.chars)
0