#abc247a. A - Move Right

A - Move Right

Score : 100100 points

问题描述

44 个正方形横向排列。

你得到一个长度为 44 的字符串 SS,仅包含字符 01
SS 中的第 ii 个字符为 1,则表示从左数第 ii 个正方形中有人;
SS 中的第 ii 个字符为 0,则表示从左数第 ii 个正方形中无人。

现在,所有人将同时向右边相邻的正方形移动。经过这次移动,原本位于最右侧正方形的人会消失。

确定在移动后每个正方形中是否有人,并以与 SS 相同格式的字符串形式打印出结果。(参见示例输入/输出以获得更清晰的理解。)

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There are 44 squares lined up horizontally.

You are given a string SS of length 44 consisting of 0 and 1.
If the ii-th character of SS is 1, there is a person in the ii-th square from the left;
if the ii-th character of SS is 0, there is no person in the ii-th square from the left.

Now, everyone will move to the next square to the right simultaneously. By this move, the person who was originally in the rightmost square will disappear.

Determine if there will be a person in each square after the move. Print the result as a string in the same format as SS. (See also Sample Input / Output for clarity.)

Constraints

  • SS is a string of length 44 consisting of 0 and 1.

Input

Input is given from Standard Input in the following format:

SS

Output

Print a string of length 44 such that the ii-th character is 1 if there will be a person in the ii-th square from the left after the move, and 0 otherwise.

Sample Input 1

1011

Sample Output 1

0101

After the move, the person who was originally in the 11-st square will move to the 22-nd square,
the person in the 33-rd square to the 44-th square,
and the person in the 44-th square will disappear.

Sample Input 2

0000

Sample Output 2

0000

Sample Input 3

1111

Sample Output 3

0111

update @ 2024/3/10 10:35:01