結果

問題 No.792 真理関数をつくろう
ユーザー RokiRoki
提出日時 2019-06-18 02:41:07
言語 Haskell
(9.8.2)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 3,117 ms
コンパイル使用メモリ 165,492 KB
実行使用メモリ 26,496 KB
最終ジャッジ日時 2023-08-20 01:39:06
合計ジャッジ時間 3,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,176 KB
testcase_01 AC 12 ms
11,672 KB
testcase_02 AC 3 ms
7,028 KB
testcase_03 AC 22 ms
12,932 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 22 ms
13,004 KB
testcase_06 AC 73 ms
20,420 KB
testcase_07 AC 6 ms
11,064 KB
testcase_08 AC 2 ms
6,884 KB
testcase_09 AC 3 ms
7,268 KB
testcase_10 AC 3 ms
7,232 KB
testcase_11 AC 2 ms
6,996 KB
testcase_12 AC 3 ms
7,552 KB
testcase_13 AC 3 ms
6,956 KB
testcase_14 AC 3 ms
6,908 KB
testcase_15 AC 5 ms
9,912 KB
testcase_16 AC 42 ms
14,796 KB
testcase_17 AC 4 ms
8,260 KB
testcase_18 AC 2 ms
6,912 KB
testcase_19 AC 3 ms
6,872 KB
testcase_20 AC 32 ms
16,504 KB
testcase_21 AC 112 ms
26,496 KB
testcase_22 AC 3 ms
6,852 KB
testcase_23 AC 2 ms
6,972 KB
testcase_24 AC 3 ms
6,884 KB
testcase_25 AC 3 ms
7,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad (replicateM)
import Data.List (intercalate)

main :: IO ()
main = do
    xs <- flip replicateM (map read . words <$> getLine) . (2^) . read =<< getLine
    let ts = filter ((==1) . last) xs
    putStrLn $ "A=" ++ if length xs == length ts then "⊤" else if null ts then "⊥" else let tss = map init ts; nl = take (length (head tss)) $ iterate (+1) 1 in intercalate "∨" ["(" ++ intercalate "∧" (zipWith (\i b -> if b == 1 then "P_" ++ show i else "¬P_" ++ show i) nl xs) ++ ")" | xs <- tss]
0