B. 「一本通 2.2 练习 4」Censoring

    Type: Default 1000ms 512MiB

「一本通 2.2 练习 4」Censoring

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.

Description

Original source: USACO 2015 Feb. Silver

Given two strings SS and TT, repeatedly find a substring A=TA = T in SS from front to back, delete it, and fill the gap by shifting the remaining characters forward. Repeat this process until SS no longer contains TT as a substring. Output the final string SS.

Input Format

The first line contains a string SS, and the second line contains a string TT.

Output Format

Output the processed string SS.

Sample 1

whatthemomooofun
moo

whatthefun

Constraints & Hints

For all test cases, 1TS1061\le |T|\le |S|\le 10^6, and it is guaranteed that the strings consist only of lowercase letters.

20251123 D班作业(7)

Not Claimed
Status
Done
Problem
2
Open Since
2025-11-24 0:00
Deadline
2025-12-1 23:59
Extension
24 hour(s)