302651: CF514A. Chewbaсca and Number
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:6
Solved:0
Description
Chewbaсca and Number
题意翻译
Luke Skywalker给了Chewbacca一个正整数$x$ ,但是Chewbacca决定把这个数改掉。他可以把整数$x$ 每个位置上的数$t$ 改成$9-t$ 。 请你帮助Chewbacca来计算一下,如何把$x$ 改成一个最小的正整数,注意,不能出现首位为$0$ 的情况。 输入范围 输入一个正整数$x(1\leq x\leq 10^{18})x(1≤x≤10 18)$ ,表示初始的数。 输出范围 输出最小可以改变的数,注意不能出现首位为$0$ 的情况。 感谢@馒头精 提供的翻译题目描述
Luke Skywalker gave Chewbacca an integer number $ x $ . Chewbacca isn't good at numbers but he loves inverting digits in them. Inverting digit $ t $ means replacing it with digit $ 9-t $ . Help Chewbacca to transform the initial number $ x $ to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn't start with a zero.输入输出格式
输入格式
The first line contains a single integer $ x $ $ (1<=x<=10^{18}) $ — the number that Luke Skywalker gave to Chewbacca.
输出格式
Print the minimum possible positive number that Chewbacca can obtain after inverting some digits. The number shouldn't contain leading zeroes.
输入输出样例
输入样例 #1
27
输出样例 #1
22
输入样例 #2
4545
输出样例 #2
4444