結果

問題 No.3092 3-2-SAT
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-04-01 21:58:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,732 KB
実行使用メモリ 80,092 KB
最終ジャッジ日時 2023-08-12 18:51:39
合計ジャッジ時間 3,622 ms
ジャッジサーバーID
(参考情報)
judge10 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,292 KB
testcase_01 AC 120 ms
79,516 KB
testcase_02 AC 136 ms
79,696 KB
testcase_03 AC 126 ms
79,128 KB
testcase_04 AC 165 ms
80,092 KB
testcase_05 AC 128 ms
78,980 KB
testcase_06 AC 69 ms
71,512 KB
testcase_07 AC 72 ms
71,228 KB
testcase_08 AC 72 ms
71,624 KB
testcase_09 AC 73 ms
71,252 KB
testcase_10 AC 72 ms
71,724 KB
testcase_11 AC 71 ms
71,236 KB
testcase_12 AC 70 ms
71,192 KB
testcase_13 AC 72 ms
71,352 KB
testcase_14 AC 72 ms
71,268 KB
testcase_15 AC 73 ms
71,196 KB
testcase_16 AC 73 ms
71,104 KB
testcase_17 AC 73 ms
71,204 KB
testcase_18 AC 72 ms
71,464 KB
testcase_19 AC 72 ms
71,140 KB
testcase_20 AC 71 ms
71,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin

N,M = map(int,input().split())
ans = [1]*N

for i in range(M):
    p,q,a,b = map(int,input().split())
    assert 1 <= a*b <= 3

    p -= 1
    q -= 1
    if not ( ans[p] == a or ans[q] == b ):
        print (-1)
        sys.exit()

print (*ans)
0