You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Problems/FlingLikFullOfVim.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
1
# FlingLikFullOfVim
2
2
3
-
Difficulty: ******
3
+
Difficulty: \*\*\*\*\*\*
4
4
5
5
Time limit: 2.00s
6
6
7
7
Memory limit: 512MB
8
8
9
9
## Background
10
10
11
-
Ernest Vincent Wright was an American author, known for writing a novel (Gadsby) without using the letter **“e”**. Bertram Liu is a big fan of Ernest and tries to imitate him in writing a novel, but is looking for a real challenge. He uses only the first ten characters of the alphabet (namely abcdefghij).
11
+
Ernest Vincent Wright was an American author, known for writing a novel (Gadsby) without using the letter **“e”**. Yinan Sun is a big fan of Ernest and tries to imitate him in writing a novel, but is looking for a real challenge. He uses only the first ten characters of the alphabet (namely abcdefghij).
12
12
13
-
Ironically, the “e” key on his computer breaks halfway through the novel, and for consistency, he decides to delete all the “e”s he has already written. His friend, a programmer, recommended him to use the text editor Vim to perform this task. Unfortunately, Bertram is not very familiar with Vim, and knows only three different commands: **“x”**, **“h”** and **“f”**.
13
+
Ironically, the “e” key on his computer breaks halfway through the novel, and for consistency, he decides to delete all the “e”s he has already written. His friend, a programmer, recommended him to use the text editor Vim to perform this task. Unfortunately, Yinan is not very familiar with Vim, and knows only three different commands: **“x”**, **“h”** and **“f”**.
14
14
15
-
-**“x”** deletes the character at the cursor. The cursor position (counted from the left) does not change. Bertram shall not use this command if the cursor is at the last character of the document.
15
+
-**“x”** deletes the character at the cursor. The cursor position (counted from the left) does not change. Yinan shall not use this command if the cursor is at the last character of the document.
16
16
-**“h”** moves the cursor one step backward (to the left). Nothing happens if the cursor is at the beginning of the document.
17
17
-**“f”** waits for the user to input another character \( C \), and then moves the cursor forward to the next occurrence of \( C \) (even if the character at the cursor happens to be \( C \)). Nothing happens if \( C \) does not occur anywhere to the right of the cursor position.
18
18
@@ -32,7 +32,7 @@ where the cursor is denoted by a frame like \(\boxed{i}\), then
32
32
33
33
## Task
34
34
35
-
Write a program that calculates the least number of key presses that Bertram needs to use to delete all the **“e”s** in the document, but no other letters. Initially, the cursor is at the first character of the document.
35
+
Write a program that calculates the least number of key presses that Yinan needs to use to delete all the **“e”s** in the document, but no other letters. Initially, the cursor is at the first character of the document.
36
36
37
37
## Input format
38
38
@@ -41,7 +41,7 @@ each one of the ten lowercase letters from **“a”** to **“j”**. The first
41
41
42
42
## Output format
43
43
44
-
The only line of output should contain exactly one integer \( T \): the least number of key presses Bertram needs to delete all the **“e”s**.
44
+
The only line of output should contain exactly one integer \( T \): the least number of key presses Yinan needs to delete all the **“e”s**.
45
45
46
46
## Example
47
47
@@ -82,4 +82,4 @@ In actual cases where \( T \ge 14 \), this is more likely to be efficient (not c
82
82
:%s/\%d101//g<Enter>
83
83
```
84
84
85
-
Ah, but alas, poor Bertram was unaware of this clever workaround, that's a pity. But let’s remain optimistic — perhaps soon he’ll stumble upon these knowledge and become a true Vim master!
85
+
Ah, but alas, poor Yinan was unaware of this clever workaround, that's a pity. But let’s remain optimistic — perhaps soon he’ll stumble upon these knowledge and become a true Vim master!
0 commit comments