結果

問題 No.5005 3-SAT
ユーザー ID 21712
提出日時 2025-02-04 02:15:39
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 666 bytes
コンパイル時間 12,811 ms
コンパイル使用メモリ 250,736 KB
実行使用メモリ 6,820 KB
スコア 97
最終ジャッジ日時 2025-02-04 02:16:06
合計ジャッジ時間 21,207 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 97 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import . "fmt"

type Cond struct {
	a,b,c,p,q,r int
}

func main() {
	conds := make([]*Cond, 2048)
	for i := range conds {
		c := new(Cond)
		conds[i] = c
		Scan(&c.a, &c.b, &c.c, &c.p, &c.q, &c.r)
	}
	
	ans := make([]int, 256)
	
	c0 := conds[0]
	ans[c0.a] = c0.p
	ans[c0.b] = c0.q
	ans[c0.c] = c0.r
	if ans[c0.a] != c0.p && ans[c0.b] != c0.q && ans[c0.c] != c0.r {
		panic(1)
	}
	
	c1 := conds[1]
	ans[c1.a] = 1-c1.p
	ans[c1.b] = 1-c1.q
	ans[c1.c] = 1-c1.r
	if ans[c1.a] == c1.p || ans[c1.b] == c1.q || ans[c1.c] == c1.r {
		return
	}
	
	s := ""
	for i := range ans {
		s += Sprint(ans[len(ans)-1-i])
	}
	if len(s) != 256 {
		panic(256)
	}
	Print(s)
}
0