시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 1306 408 363 36.519%

문제

이진수 덧셈은 매우 간단하고, 십진수 덧셈과 비슷하게 하면 된다. 십진수 덧셈을 할 때는, 오른쪽부터 왼쪽으로 차례대로 숫자 하나씩 더하면 된다. 이진수 덧셈도 이와 비슷하게 하면 된다. 십진수 덧셈은 외워야 할 덧셈이 많지만, 이진수 덧셈은 아래와 같이 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
W3sicHJvYmxlbV9pZCI6IjI3MjkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NzRcdWM5YzRcdWMyMTggXHViMzY3XHVjMTQ4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM3NzRcdWM5YzRcdWMyMTggXHViMzY3XHVjMTQ4XHVjNzQwIFx1YjllNFx1YzZiMCBcdWFjMDRcdWIyZThcdWQ1NThcdWFjZTAsIFx1YzJlZFx1YzljNFx1YzIxOCBcdWIzNjdcdWMxNDhcdWFjZmMgXHViZTQ0XHVjMmI3XHVkNTU4XHVhYzhjIFx1ZDU1OFx1YmE3NCBcdWI0MWNcdWIyZTQuIFx1YzJlZFx1YzljNFx1YzIxOCBcdWIzNjdcdWMxNDhcdWM3NDQgXHVkNTYwI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WdlciBOLCAoMSAmbHQ7PSBOICZsdDs9IDEwMDApLCB3aGljaCBpcyB0aGUgbnVtYmVyIG9mIGJpbmFyeSBhZGRpdGlvbiBwcm9ibGVtcyB0aGF0IGZvbGxvdy4gRWFjaCBwcm9ibGVtIGFwcGVhcnMgb24gYSBzaW5nbGUgbGluZSBjb250YWluaW5nIHR3byBiaW5hcnkgdmFsdWVzIHNlcGFyYXRlZCBieSBhIHNpbmdsZSBzcGFjZSBjaGFyYWN0ZXIuIFRoZSBtYXhpbXVtIGxlbmd0aCBvZiBlYWNoIGJpbmFyeSB2YWx1ZSBpcyA4MCBiaXRzIChiaW5hcnkgZGlnaXRzKS4gTm90ZTogVGhlIG1heGltdW0gbGVuZ3RoIHJlc3VsdCBjb3VsZCBiZSA4MSBiaXRzIChiaW5hcnkgZGlnaXRzKS4mbmJzcDs8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5Gb3IgZWFjaCBiaW5hcnkgYWRkaXRpb24gcHJvYmxlbSwgcHJpbnQgdGhlIHByb2JsZW0gbnVtYmVyLCBhIHNwYWNlLCBhbmQgdGhlIGJpbmFyeSByZXN1bHQgb2YgdGhlIGFkZGl0aW9uLiBFeHRyYSBsZWFkaW5nIHplcm9lcyBtdXN0IGJlIG9taXR0ZWQuJm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

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

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