시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 6 3 2 66.667%

문제

Matchball 테니스 클럽에서 새로운 회원을 모집하기 위해 "game interest week"를 개최한다. 이목을 끌기 위해 스타플레이어들이 데모게임을 하는데, 각 플레이어는 뛸 경기수를 정하고 주최측은 재미를 위해 각 플레이어들이 서로 두번이상 매치되지 않게 대진표를 짜길 원한다. 각 플레이어들이 정한 횟수만큼 경기를 치르고, 두번이상 같은 선수와 매치되지 않게 대진표를 만드는 프로그램을 구현하시오.(자기자신과는 매치될 수 없다.)

입력

첫줄에는 플레이어의 수 N이 입력된다. (2 ≤ N ≤ 1000)

다음 N줄에는 각 플레이어의 게임횟수 Gi가 입력된다.(1 ≤ Gi < N)

플레이어들은 지망한 순서대로 1~N까지 번호가 매겨져 있다고 가정한다.

출력

첫줄에는 모든 플레이어의 매치가 만족한다면 'SCHEDULE' 아니라면 'NO SCHEDULE'을 출력한다.

스케줄이 존재한다면 게임횟수 입력줄에 대응되는 상대선수의 번호를 N줄까지 한줄씩 출력한다. 각 줄에는 선수번호가 오름차순으로 공백으로 구분하여 출력되어야 한다. (여러가지 해결방법이 존재한다면 그 중 하나를 출력한다.)

예제 입력 1

3
1
2
1

예제 출력 1

SCHEDULE
2
1 3
2

예제 입력 2

3
2
2
1

예제 출력 2

NO SCHEDULE
W3sicHJvYmxlbV9pZCI6IjMzODYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQxNGNcdWIyYzhcdWMyYTQgXHVkMDc0XHViN2ZkIiwiZGVzY3JpcHRpb24iOiI8cD5NYXRjaGJhbGwgXHVkMTRjXHViMmM4XHVjMmE0IFx1ZDA3NFx1YjdmZFx1YzVkMFx1YzExYyBcdWMwYzhcdWI4NWNcdWM2YjQgXHVkNjhjXHVjNmQwXHVjNzQ0IFx1YmFhOFx1YzlkMVx1ZDU1OFx1YWUzMCBcdWM3MDRcdWQ1NzQgJnF1b3Q7Z2FtZSBpbnRlcmVzdCB3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BvcmRlciBhbmQgc2VwYXJhdGVkIGJ5IHNwYWNlcy4gSWYgbXVsdGlwbGUgc29sdXRpb25zIGV4aXN0LCBvdXRwdXQgYW55IG9uZSBvZiB0aGVtLiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiI8cD5JbiB0aGlzIHRhc2ssIGEgcHJvZ3JhbSByZWNlaXZlcyBwb2ludHMgZm9yIHRlc3RzIHdpdGggbm8gc2NoZWR1bGUgb25seSBpZiBpdCBzb2x2ZXMgY29ycmVjdGx5IGF0IGxlYXN0IGhhbGYgb2YgdGhlIHRlc3RzIHdpdGggYSBzY2hlZHVsZS4mbmJzcDs8XC9wPlxyXG4iLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

Olympiad > Baltic Olympiad in Informatics > BOI 2002 2번

  • 문제를 번역한 사람: dark2840
  • 문제의 오타를 찾은 사람: jh05013
  • 스페셜 저지를 만든 사람: onjo0127