Bitwise modulo 3
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given two non-negative ternary numbers, your task is to compute a new ternary number by performing a digit-wise addition modulo 3 on all ternary numbers that lie between the two given numbers, inclusive.
Each of the provided numbers can have up to 250,000 digits.
Input
The input consists of two lines. The first line contains the first ternary number, and the second line contains the second ternary number.
Output
Output a single line containing the resulting ternary number.
Examples
Input #1
Answer #1
Submissions 223
Acceptance rate 32%