시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 986 280 249 34.298%

문제

이진수 덧셈은 매우 간단하고, 십진수 덧셈과 비슷하게 하면 된다. 십진수 덧셈을 할 때는, 오른쪽부터 왼쪽으로 차례대로 숫자 하나씩 더하면 된다. 이진수 덧셈도 이와 비슷하게 하면 된다. 십진수 덧셈은 외워야 할 덧셈이 많지만, 이진수 덧셈은 아래와 같이 5가지만 기억하면 된다.

0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = 10
1 + 1 + 1 = 11

두 이진수가 주어졌을 때, 그 합을 이진수로 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 수 T(1<=T<=1,000)가 주어진다. 각 테스트 케이스는 숫자 2개로 이루어져있다. 이 숫자는 0과 1로만 이루어진 이진수이며, 길이는 최대 80자리이다. (덧셈 결과는 81자리가 될 수도 있다) 이진수는 0으로 시작할 수도 있다.

출력

각 테스트 케이스에 대해 입력으로 주어진 두 이진수의 합을 구해 이진수로 출력한다. 숫자의 앞에 불필요한 0이 붙으면 안된다.

예제 입력 1

3
1001101 10010
1001001 11001
1000111 1010110

예제 출력 1

1011111
1100010
10011101

힌트

W3sicHJvYmxlbV9pZCI6IjI3MjkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NzRcdWM5YzRcdWMyMTggXHViMzY3XHVjMTQ4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM3NzRcdWM5YzRcdWMyMTggXHViMzY3XHVjMTQ4XHVjNzQwIFx1YjllNFx1YzZiMCBcdWFjMDRcdWIyZThcdWQ1NThcdWFjZTAsIFx1YzJlZFx1YzljNFx1YzIxOCBcdWIzNjdcdWMxNDhcdWFjZmMgXHViZTQ0XHVjMmI3XHVkNTU4XHVhYzhjIFx1ZDU1OFx1YmE3NCBcdWI0MWNcdWIyZTQuIFx1YzJlZFx1YzljNFx1YzIxOCBcdWIzNjdcdWMxNDhcdWM3NDQgXHVkNTY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pbnRlZ2VyIE4sICgxICZsdDs9IE4gJmx0Oz0gMTAwMCksIHdoaWNoIGlzIHRoZSBudW1iZXIgb2YgYmluYXJ5IGFkZGl0aW9uIHByb2JsZW1zIHRoYXQgZm9sbG93LiBFYWNoIHByb2JsZW0gYXBwZWFycyBvbiBhIHNpbmdsZSBsaW5lIGNvbnRhaW5pbmcgdHdvIGJpbmFyeSB2YWx1ZXMgc2VwYXJhdGVkIGJ5IGEgc2luZ2xlIHNwYWNlIGNoYXJhY3Rlci4gVGhlIG1heGltdW0gbGVuZ3RoIG9mIGVhY2ggYmluYXJ5IHZhbHVlIGlzIDgwIGJpdHMgKGJpbmFyeSBkaWdpdHMpLiBOb3RlOiBUaGUgbWF4aW11bSBsZW5ndGggcmVzdWx0IGNvdWxkIGJlIDgxIGJpdHMgKGJpbmFyeSBkaWdpdHMpLiZuYnNwOzxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPkZvciBlYWNoIGJpbmFyeSBhZGRpdGlvbiBwcm9ibGVtLCBwcmludCB0aGUgcHJvYmxlbSBudW1iZXIsIGEgc3BhY2UsIGFuZCB0aGUgYmluYXJ5IHJlc3VsdCBvZiB0aGUgYWRkaXRpb24uIEV4dHJhIGxlYWRpbmcgemVyb2VzIG11c3QgYmUgb21pdHRlZC4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

ACM-ICPC > Regionals > North America > Greater New York Region > 2005 Greater New York Programming Contest A번

  • 문제를 번역한 사람: baekjoon
  • 빠진 조건을 찾은 사람: djm03178
  • 문제의 오타를 찾은 사람: qja0950