این مسابقه به صورت حضوری در تاریخ ۱۴ آذر ۱۴۰۳ در سایت دانشکده برق و کامپیوتر دانشگاه تهران برگزار می‌شود. علاقه‌مندان می‌توانند به صورت همزمان در مسابقه آنلاین که شامل همان سوالات می‌باشد شرکت کنند.

Number Collision


  • محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۶۴ مگابایت

A long, long time ago in a galaxy far, far away a big collision of integers is taking place right now. What happens when two integers collide? During collision, each digit of one number compares itself to the corresponding digit of the other number (the least significant digit with the other’s least significant digit, and so on). The smaller digit “falls out” of the number containing it. Additionally, if the digits are the same, nothing happens. If a number doesn’t consist of a corresponding digit, then we consider it to be zero. After all comparisons of corresponding digits, the leftover digits in the number come closer and create a new number. For example:

توضیح تصویر

Write a program that will, for two given integers, determine their values \textbf{after collision}. If it happens that all the digits of one number fell out, then for that number output the message “Zekiii!”.

input🔗

e first line of input contains the integer N, one of the integers from the task.

The second line of input contains the integer M, one of the integers from the task.

Output🔗

The two lines of output must contain the new value of the first and second given integer from the task.

Constraints🔗

  • 1N,M1091 \leq N,M \leq 10^9

Sample Test Data🔗

input 1🔗

65743
9651
Plain text

output 1🔗

673
95
Plain text

input 2🔗

3412
7586
Plain text

output 2🔗

Zekiii!
7586
Plain text
ارسال پاسخ برای این سؤال
در حال حاضر شما دسترسی ندارید.