結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,040 KB
testcase_01 AC 83 ms
15,192 KB
testcase_02 AC 82 ms
15,096 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
a=gets.split.map(&:to_i)
def dfs a,n
  if a[0]
    if dfs(a[1..-1],n+a[0])
      print ?+
      true
    elsif dfs(a[1..-1],n*a[0])
      print ?*
      true
    end
  else
    n==$t
  end
end
dfs a[1..-1],a[0]
puts
0