結果

問題 No.10 +か×か
ユーザー gigurururugigurururu
提出日時 2014-11-27 00:02:43
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 190 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 11,308 KB
実行使用メモリ 76,148 KB
最終ジャッジ日時 2023-09-01 22:18:03
合計ジャッジ時間 6,993 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
19,500 KB
testcase_01 AC 79 ms
15,040 KB
testcase_02 AC 78 ms
15,160 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]?n<=$t&&[?+,?*].any?{|o|dfs(i+1,eval(n.to_s+o+$a[i]))&&(print o;true)}:n==$t
end

dfs 0,s.to_i
puts
0