結果

問題 No.3092 3-2-SAT
ユーザー floraflora
提出日時 2022-04-01 21:59:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,604 KB
実行使用メモリ 94,120 KB
最終ジャッジ日時 2024-04-30 13:59:40
合計ジャッジ時間 3,730 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 84 ms
90,700 KB
testcase_07 AC 41 ms
60,328 KB
testcase_08 AC 50 ms
72,648 KB
testcase_09 AC 36 ms
54,840 KB
testcase_10 AC 45 ms
69,792 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())

x=[set([1,2,3]) for _ in range(N)]
for _ in range(M):
	p,q,a,b=map(int,input().split())
	p-=1
	q-=1
	if a in x[p]:
		x[p].remove(a)
		if len(x[p])==0:
			print(-1)
			exit()
	if b in x[q]:
		x[q].remove(b)
		if len(x[q])==0:
			print(-1)
			exit()
	
y=[]
for i in range(N):
	y.append(x[i].pop())
print(*y)
0