QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 64 MB مجموع النقاط: 50

#13768. YODA

الإحصائيات

很久很久以前,在遥远的星系中,一场整数的大碰撞正在发生。

当两个整数碰撞时会发生什么?在碰撞过程中,一个数字的每一位都会与另一个数字的对应位进行比较(最低有效位与另一个数字的最低有效位进行比较,依此类推)。较小的数位会从包含它的数字中“脱落”。此外,如果两个数位相同,则什么都不会发生。如果一个数字没有对应的数位,则我们将其视为 $0$。在对所有对应数位进行比较之后,数字中剩余的数位会靠拢并组成一个新数字。例如:

编写一个程序,对于给定的两个整数,确定它们碰撞后的值。如果某个数字的所有数位都脱落了,则对于该数字输出 “YODA”。

输入格式

输入的第一行包含整数 $N$($1 \le N \le 10^9$),是题目中的整数之一。

输入的第二行包含整数 $M$($1 \le M \le 10^9$),是题目中的整数之一。

输出格式

输出的第一行必须包含第一个给定整数碰撞后的新值。

输出的第二行必须包含第二个给定整数碰撞后的新值。

子任务

在占总分 $30\%$ 的测试用例中,保证 $N$ 和 $M$ 均由三位数字组成。

样例

输入样例 1

300
500

输出样例 1

0
500

输入样例 2

65743
9651

输出样例 2

673
95

输入样例 3

2341
6785

输出样例 3

YODA
6785

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.