传统题 1000ms 256MiB

B - 180°

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

B - 180°

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 a 0, each 1 with a 1, each 6 with a 9, each 8 with an 8, and each 9 with a 6.

Constraints

  • $1 \leq |S| \leq 10^5$
  • $S$ consists of 0, 1, 6, 8, and 9.

Input

Input is given from Standard Input in the following format:

SS

Output

Print the result of rotating $S$ $180$ degrees.


0601889
6881090

Rotating 0601889 $180$ degrees results in 6881090.


86910
01698

01010
01010

$S$ may remain the same.

2024寒假入门组刷题营(十四)

未参加
状态
已结束
规则
ACM/ICPC
题目
8
开始于
2024-2-14 13:30
结束于
2024-2-14 15:30
持续时间
2 小时
主持人
参赛人数
9