結果

問題 No.10 +か×か
ユーザー gigurururugigurururu
提出日時 2014-11-27 00:19:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 233 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 11,348 KB
実行使用メモリ 94,180 KB
最終ジャッジ日時 2023-09-01 22:18:44
合計ジャッジ時間 6,169 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

gets
$t=gets.to_i
s,*$a=gets.split.map(&:to_i)

$memo={}
#見つけたらfalseを返すキモイ関数
def dfs i,n
  $memo[[i,n]]||=$a[i]?n>$t||[:+,:*].all?{|o|dfs(i+1,n.send(o,$a[i]))||(print o)}:n!=$t
end

dfs 0,s
puts
0