시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 3484 1261 1037 37.682%

문제

A*B를 계산하다 지겨워진 형택이는 A*B를 새로운 방법으로 정의하려고 한다.

A에서 한 자리를 뽑고 * B에서 임의로 한 자리를 뽑아 곱한다.

의 가능한 모든 조합 (A가 n자리, B가 m자리 수라면 총 가능한 조합은 n*m개)을 더한 수로 정의하려고 한다.

예를 들어 121*34는

1*3 + 1*4 + 2*3 + 2*4 + 1*3 + 1*4 = 28

이 된다. 이러한 형택이의 곱셈 결과를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 A와 B가 주어진다. 주어지는 두 수는 모두 10,000자리를 넘지 않는다.

출력

첫째 줄에 형택이의 곱셈 결과를 출력한다.

예제 입력 1

123 45

예제 출력 1

54
W3sicHJvYmxlbV9pZCI6IjEyMjUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NzRcdWMwYzFcdWQ1NWMgXHVhY2YxXHVjMTQ4IiwiZGVzY3JpcHRpb24iOiI8cD5BKkJcdWI5N2MgXHVhY2M0XHVjMGIwXHVkNTU4XHViMmU0IFx1YzljMFx1YWNhOFx1YzZjY1x1YzljNCBcdWQ2MTVcdWQwZGRcdWM3NzRcdWIyOTQgQSpCXHViOTdjIFx1YzBjOFx1Yjg1Y1x1YzZiNCBcdWJjMjlcdWJjOTVcdWM3M2NcdWI4NWMgXHVjODE1XHVjNzU4XHVkNTU4XHViODI0XHVhY2UwIFx1ZDU1Y1x1YjJlNC48XC9wPlxyXG48cD5BXHVjNWQwXHVjMTFjIFx1ZDU1YyBcdWM3OTBcdWI5YWNcdWI5N2MgXHViZjUxXHVhY2UwICogQlx1YzVkMFx1YzExYyBcdWM3ODRcdWM3NThcdWI4NWMgXHVkNTVjIFx1Yzc5MFx1YjlhY1x1Yjk3YyBcdWJmNTFcdWM1NDQgXHVhY2YxXHVkNTVjXHViMmU0LjxcL3A+XHJcbjxwPlx1Yzc1OCBcdWFjMDBcdWIyY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vdXRwdXQiOiI8dWw+XHJcblx0PGxpPkxpbmUgMTogQSBzaW5nbGUgbGluZSB0aGF0IGlzIHRoZSBBKkIgaW4gQmVzc2llJiMzOTtzIHN0eWxlIG9mIG11bHRpcGxpY2F0aW9uLjxcL2xpPlxyXG48XC91bD5cclxuXHJcbjxwPiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

Olympiad > USA Computing Olympiad > 2007-2008 Season > USACO February 2008 Contest > Bronze 3번

  • 문제를 번역한 사람: author5
  • 문제의 오타를 찾은 사람: cubelover