시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 64 MB 200 128 118 65.193%

문제

아주 먼 옛날 수 억광년 떨어진 곳에서 두 정수 은하가 충돌한 것을 연정이가 최초로 발견했다. 

그런데 우리가 알고 있는 은하 충돌과 달리 두 정수 은하는 충돌하는 과정에서 동일한 위치에 존재하는 행성이 가지는 숫자가 더 작으면 해당 행성은 소멸한다. (단 숫자가 같은 경우에는 두 행성 모두 소멸하지 않는다)

두 정수 은하가 충돌한 뒤 각 은하에 남은 행성이 가지는 수를 공백없이 출력하시오.

입력

각 줄에는 첫 번째 은하가 가지는 행성의 집합 (N) 과 두 번째 은하가 가지는 행성의 집합 (M) 이 입력된다. (1 ≤ N , M ≤ 109)

출력

첫 줄에는 첫 번째 은하가 충돌한 결과를 두 번째 줄에는 두 번째 은하가 충돌한 결과를 출력하시오.

은하의 모든 행성이 소멸되었을 경우, 그 은하에 대해서 "YODA"를 출력해야 한다.

예제 입력 1

300
500

예제 출력 1

0
500

예제 입력 2

65743
9651

예제 출력 2

673
95

예제 입력 3

2341
6785

예제 출력 3

YODA
6785
W3sicHJvYmxlbV9pZCI6IjExODA5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjZGE5XHViM2NjIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1NDRcdWM4ZmMgXHViYTNjIFx1YzYxYlx1YjBhMCBcdWMyMTggXHVjNWI1XHVhZDExXHViMTQ0IFx1YjVhOFx1YzViNFx1YzljNCBcdWFjZjNcdWM1ZDBcdWMxMWMgXHViNDUwIFx1YzgxNVx1YzIxOCZuYnNwO1x1Yzc0MFx1ZDU1OFx1YWMwMCBcdWNkYTlcdWIzY2NcdWQ1NWMgXHVhYzgzXHVjNzQ0IFx1YzVmMFx1YzgxNVx1Yzc3NFx1YWMwMCBcdWNkNWNcdWNkMDhcdWI4NWMgXHViYzFjXHVhY2FjXHVkNTg4XHViMmU0LiZuYnNwOzxcL3A+XHJcblxyXG48cD5cdWF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W5lIG9mIGlucHV0IGNvbnRhaW5zIHRoZSBpbnRlZ2VyIE4gKDEgJmxlOyBOICZsZTsgMTA8c3VwPjk8XC9zdXA+KSwgb25lIG9mIHRoZSBpbnRlZ2VycyBmcm9tIHRoZSB0YXNrLiBUaGUgc2Vjb25kIGxpbmUgb2YgaW5wdXQgY29udGFpbnMgdGhlIGludGVnZXIgTSAoMSAmbGU7IE4gJmxlOyAxMDxzdXA+OTxcL3N1cD4pLCBvbmUgb2YgdGhlIGludGVnZXJzIGZyb20gdGhlIHRhc2suPFwvcD5cclxuIiwib3V0cHV0IjoiPHA+VGhlIGZpcnN0IGxpbmUgb2Ygb3V0cHV0IG11c3QgY29udGFpbiB0aGUgbmV3IHZhbHVlIG9mIHRoZSBmaXJzdCBnaXZlbiBpbnRlZ2VyIGZyb20gdGhlIHRhc2suIFRoZSBzZWNvbmQgbGluZSBvZiBvdXRwdXQgbXVzdCBjb250YWluIHRoZSBuZXcgdmFsdWUgb2YgdGhlIHNlY29uZCBnaXZlbiBpbnRlZ2VyIGZyb20gdGhlIHRhc2suPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

Contest > Croatian Open Competition in Informatics > COCI 2015/2016 > Contest #4 1번

  • 빠진 조건을 찾은 사람: appa
  • 문제를 번역한 사람: john6014