ABC202B - 180°
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Score : 200 points
Problem Statement
You are given a string S consisting of 0
, 1
, 6
, 8
, and 9
.
Rotate S 180 degrees and print the result. In other words, apply the following operations on S and print the resulting string:
- Reverse S.
- Replace each
0
with a0
, each1
with a1
, each6
with a9
, each8
with an8
, and each9
with a6
.
Constraints
- 1≤∣S∣≤105
- S consists of
0
,1
,6
,8
, and9
.
Input
Input is given from Standard Input in the following format:
S
Output
Print the result of rotating S 180 degrees.
Sample Input 1
0601889
Sample Output 1
6881090
Rotating 0601889
180 degrees results in 6881090
.
Sample Input 2
86910
Sample Output 2
01698
Sample Input 3
01010
Sample Output 3
01010
S may remain the same.
ABC202
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2023-6-28 14:15
- End at
- 2023-6-28 16:39
- Duration
- 2.4 hour(s)
- Host
- Partic.
- 13