Skip to main content
  1. Posts/

poj 2157 Maze (bfs)

Note: This article is available in Chinese only. 本文暂无英文版本。 View original

Related

cf 570 C. Replacement (暴力)

·2 mins
C. Replacement time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Daniel has a string s, consisting of lowercase English letters and period signs (characters ‘.’). Let’s define the operation of replacement as the following sequence of steps: find a substring “..” (two consecutive periods) in string s, of all occurrences of the substring let’s choose the first one, and replace this substring with string “.”. In other words, during the replacement operation, the first two consecutive periods are replaced by one. If string s contains no two consecutive periods, then nothing happens.