시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
3 초 128 MB 295 145 88 48.619%

문제

어떤 나라에서는 (뭔 나라인지는 기억이 안 나지만), 후보 {1, 2 ... N}이 나와서 국회의원 선거를 치루고 있다. 여론조사에서는 사람들마다 "만약 두 후보 i, j에 대해서, 그 두 후보의 선거 결과가 어떻게 나오면 행복할 것 같으세요?" 라고 물어봤다. 이 질문에 대한 가능한 답변은 밑의 표에 나와있고, i와 j가 동일할 수도 있다.

우리는 M개의 가능한 답변의 리스트를 가지고 있고, 이 M개의 답변 중 비슷하거나 동일한 것이 있을 수도 있다. 만약에 이 M개의 답변을 동시에 만족하는 선거 결과가 있다면, 이 선거 결과를 완벽하다고 한다. (다만, 후보 {1, 2 ... N}이 모두 당선되거나 모두 낙선될 수도 있고, 이 중 일부만 당선될 수도 있다!)

우리가 할 일은 M개의 답변에 대해서 완벽한 선거 결과가 있으면 1을, 아니면 0을 출력하는 것이다.

아래의 표는 설문조사의 결과가 어떻게 들어오는 지를 알려준다.

여론조사에서 가능한 답변 입력 양식
나는 i와 j 둘 중 한 명은 당선되었으면 좋겠어. +i +j
난 i랑 j 둘 중 한 명은 떨어졌으면 좋겠어. -i -j
난 i가 붙거나 j가 떨어지거나, 둘 다 만족했음 좋겠어. +i -j
난 j가 붙거나 i가 떨어지거나, 둘 다 만족했음 좋겠어. -i +j

입력

각 테스트 케이스는 두 수 N과 M을 입력받으며 시작한다. (1≤N≤1000, 1≤M≤1000000) 그리고 이어서 M개의 순서쌍 ±i ±j 가 주어진다. (1≤i,j≤N) 각 순서쌍은 위의 표대로 해석하면 된다.

각 입력 값들은 공백으로 구분되며, 입력의 끝에는 EOF(End of File)가 주어진다.

출력

각 테스트 케이스에 대해서 완벽한 선거 결과가 존재하는지 출력한다. 선거 결과는 매 줄마다 하나씩 출력하며, 출력하는 중간에 빈 줄이 존재해서는 안 된다.

입출력 예시는 아래와 같다.

예제 입력 1

3 3  +1 +2  -1 +2  -1 -3
2 3  -1 +2  -1 -2  +1 -2
2 4  -1 +2  -1 -2  +1 -2  +1 +2
2 8  +1 +2  +2 +1  +1 -2  +1 -2  -2 +1  -1 +1  -2 -2  +1 -1

예제 출력 1

1
1
0
1

힌트

첫 테스트 케이스의 결과는 1이다. 가능한 완벽한 선거 결과는 여러 가지가 있는데, 2만 당선되는 경우를 생각할 수 있다.

두 번째 테스트 케이스의 결과 또한 1이다. 이 경우에는 1과 2 모두 당선되면 안 된다.

세 번째 테스트 케이스의 결과는 0인데, -1 +2와 -1 -2에 따르면 1은 당선되면 안 되지만 +1 -2와 +1 +2에 따르면 1은 당선되어야하기 때문이다.

네 번째 테스트 케이스는 비슷하거나 동일한 답변이 섞여있는데, 답은 1이다.

W3sicHJvYmxlbV9pZCI6IjM3NDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM2NDRcdWJjYmRcdWQ1NWMgXHVjMTIwXHVhYzcwISIsImRlc2NyaXB0aW9uIjoiPHA+XHVjNWI0XHViNWE0IFx1YjA5OFx1Yjc3Y1x1YzVkMFx1YzExY1x1YjI5NCAoXHViYjU0IFx1YjA5OFx1Yjc3Y1x1Yzc3OFx1YzljMFx1YjI5NCBcdWFlMzBcdWM1YjVcdWM3NzQgXHVjNTQ4IFx1YjA5OFx1YzljMFx1YjljYyksIFx1ZDZjNFx1YmNmNCB7MSwgMiAuLi4gTn1cdWM3NzQgXHViMDk4XHVjNjQwXHVjMTFjIFx1YWQ2ZFx1ZDY4Y1x1Yzc1OFx1YzZkMCBcdWMxMjBcdWFjNzBcdWI5N2MgXHVjZTU4XHViOGU4XHVhY2UwIFx1Yzc4OFx1YjJlNC4gXHVjNWVjXHViODYwXHVjODcwXHVjMGFjXHVjNWQwXHVjMTFjXHViMjk0IFx1YzBhY1x1Yjc4Y1x1YjRlNFx1YjljOFx1YjJlNCAmcXVvdDtcdWI5Y2NcdWM1N2QgXHViNDUwIFx1ZDZjNFx1YmNmNCBpLCBqXHVjNWQwIFx1YjMwMFx1ZD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G5vIHBlcmZlY3QgZWxlY3Rpb24gb3V0Y29tZS4gRm9yIHRoZSBmb3VydGggZGF0YSBzZXQgbm90aWNlIHRoYXQgdGhlcmUgYXJlIHNpbWlsYXIgb3IgaWRlbnRpY2FsIHBvbGwgYW5zd2VycyBhbmQgdGhhdCBzb21lIGFuc3dlcnMgbWVudGlvbiBhIHNpbmdsZSBjYW5kaWRhdGUuIFRoZSByZXN1bHQgaXMgMS4mbmJzcDs8XC9wPlxyXG4iLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2008 C번

  • 문제의 오타를 찾은 사람: f52985
  • 문제를 번역한 사람: jhs7jhs