結果

問題 No.10 +か×か
ユーザー gigurururugigurururu
提出日時 2014-11-26 23:58:29
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 178 bytes
コンパイル時間 65 ms
コンパイル使用メモリ 11,496 KB
実行使用メモリ 92,392 KB
最終ジャッジ日時 2023-09-01 22:17:54
合計ジャッジ時間 6,986 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
19,520 KB
testcase_01 AC 84 ms
15,300 KB
testcase_02 AC 81 ms
15,124 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
$t=gets.to_i
s,*$a=gets.split

$memo={}
def dfs i,n
  $memo[[i,n]]||=$a[i]?[?+,?*].any?{|o|dfs(i+1,eval(n.to_s+o+$a[i]))&&(print o;true)}:n==$t
end

dfs 0,s
puts
0