結果

問題 No.792 真理関数をつくろう
ユーザー char134217728char134217728
提出日時 2019-02-22 21:56:17
言語 Ruby
(3.3.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 288 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 11,424 KB
実行使用メモリ 17,124 KB
最終ジャッジ日時 2023-08-16 18:33:05
合計ジャッジ時間 3,118 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,052 KB
testcase_01 AC 75 ms
15,244 KB
testcase_02 AC 72 ms
15,112 KB
testcase_03 AC 84 ms
15,296 KB
testcase_04 AC 71 ms
15,232 KB
testcase_05 AC 82 ms
15,180 KB
testcase_06 AC 107 ms
16,032 KB
testcase_07 AC 72 ms
15,304 KB
testcase_08 AC 67 ms
15,224 KB
testcase_09 AC 67 ms
15,072 KB
testcase_10 AC 66 ms
15,164 KB
testcase_11 AC 67 ms
15,140 KB
testcase_12 AC 69 ms
15,164 KB
testcase_13 AC 67 ms
15,148 KB
testcase_14 AC 70 ms
15,068 KB
testcase_15 AC 68 ms
15,348 KB
testcase_16 AC 87 ms
15,616 KB
testcase_17 AC 69 ms
15,340 KB
testcase_18 AC 71 ms
15,272 KB
testcase_19 AC 66 ms
15,232 KB
testcase_20 AC 81 ms
15,284 KB
testcase_21 AC 131 ms
17,124 KB
testcase_22 AC 68 ms
15,284 KB
testcase_23 AC 67 ms
15,152 KB
testcase_24 AC 68 ms
15,288 KB
testcase_25 AC 68 ms
15,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = []
n = gets.to_i
(2**n).times.map{
  b = gets.split.map &:to_i
  if b[-1] == 1
    a << b[0..-2]
  end
}
if a.length==0
  puts "A=⊥"
elsif a.length==(2**n)
  puts "A=⊤"
else
  puts "A=#{a.map{|b| "(" + b.map.with_index{|c, i| ["¬",""][c]+"P_"+(i+1).to_s}*'∧' + ")"}*'∨'}"
end
0