結果
問題 |
No.792 真理関数をつくろう
|
ユーザー |
|
提出日時 | 2019-05-17 12:35:03 |
言語 | Nim (2.2.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,106 bytes |
コンパイル時間 | 3,682 ms |
コンパイル使用メモリ | 66,560 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 01:30:35 |
合計ジャッジ時間 | 4,624 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 22 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(5, 1) Warning: template 'times' is implicitly redefined; this is deprecated, add an explicit .redefine pragma [ImplicitTemplateRedefinition]
ソースコード
import sequtils,strutils,strformat template times*(n:int,body) = (for _ in 0..<n: body) template `max=`*(x,y) = x = max(x,y) template `min=`*(x,y) = x = min(x,y) template times*(n:int,body) = (for _ in 0..<n: body) # template stopwatch(body) = (let t1 = cpuTime();body;stderr.writeLine "TIME:",(cpuTime() - t1) * 1000,"ms") proc `^^`(n:int) : int{.inline.} = (1 shl n) proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" ,discardable.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0' : return result = 10 * result + k.ord - '0'.ord proc scanchar():char = result = getchar_unlocked() discard getchar_unlocked() let n = scan() var Q = newSeq[string]() (^^n).times: let arr = newSeqWith(n+1,scan()) if arr[^1] == 0 : continue var ans = newSeq[string]() for j in 0..<n: var s = "" if arr[j] == 0 : s &= "¬" s &= fmt"P_{j+1}" ans &= s Q &= "(" & ans.join("∧") & ")" stdout.write "A=" if Q.len == 0 : quit "⊥",0 if Q.len == ^^n : quit "⊤",0 stdout.write Q[0] for i in 1..<Q.len: stdout.write "∨",Q[i] echo ""