結果
| 問題 |
No.8092 3-2-SAT
|
| コンテスト | |
| ユーザー |
googol_S0
|
| 提出日時 | 2022-04-01 21:33:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 178 ms / 2,000 ms |
| コード長 | 427 bytes |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 88,960 KB |
| 最終ジャッジ日時 | 2024-11-20 08:24:11 |
| 合計ジャッジ時間 | 3,120 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
N,M=map(int,input().split())
ANS=[1]*N
Q=[list(map(int,input().split())) for i in range(M)]
for i in range(M):
Q[i][0]-=1
Q[i][1]-=1
if (not(1<=Q[i][2]<=3)) and (not(1<=Q[i][3]<=3)):
print(-1)
exit()
if (not(1<=Q[i][2]<=3)):
ANS[Q[i][1]]=Q[i][3]
if (not(1<=Q[i][3]<=3)):
ANS[Q[i][0]]=Q[i][2]
for i in range(M):
if ANS[Q[i][0]]!=Q[i][2] and ANS[Q[i][1]]!=Q[i][3]:
print(-1)
exit()
print(*ANS)
googol_S0