시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 169 18 12 21.429%

문제

모든 버그(bug)가 벌레라는 뜻은 아니다. 개발자에게 악몽인 버그도 있다. 이 버그는 바로 여러분이 아는 "니가 짠 프로그램에서 버그 발견됐다 ㅋ" 라고 말할 때 쓰는 버그다. 말 안해도 알겠지만 버그는 없애도 나오고 없애도 나온다. 젠장...

그래서 최근 "버그잡는 꿍" 이라고 불리는 꽤나 유용한 계획이 나타났다. 이 프로그램은 여러분의 소스에 있는 모든 버그를 찾아서 제거할 수 있다. 그래서 여러분은 소스코드에 나타난 모든 버그를 제거하는 프로그램인 "버그잡는 꿍" 프로그램을 만들어야 한다.

입력

입력은 몇 개의 테스트케이스로 이루어진다. 각 테스트 케이스는 T (0 ≤ T ≤ 100 000)를 포함하는 하나의 정수, 하나의 공백, 그리고 버그를 뜻하는 문자열 B로 시작한다.

다음 T줄에는 버그를 없애야 할 소스코드가 주어진다. 모든 버그는 대소문자가 구분되는 문자열 B에 의해 나타내어진다.

입력의 각 줄의 길이는 0~2,000,000 글자이며 버그를 나타내는 문자열 B는 1~1000개의 영어 대문자로 이루어져있다.

출력

소스코드의 각 줄마다, B가 더 이상 등장하지 않을 때까지 맨 처음 등장하는 B를 반복해서 지운 결과를 출력한다.

출력 결과에는 절대 어떠한 버그도 나타나서는 안되며 그 외의, 공백을 포함한 모든 것들은 반드시 그대로 출력한다.

예제 입력 1

7 BUG
print "No bugs here..."

void hello() {
BUGBUG
  printfBUG("Hello, world!\n");
}

1 ERR
wriERRERRtelERRn("Hello E-R-R");

예제 출력 1

print "No bugs here..."

void hello() {

  printf("Hello, world!\n");
}

writeln("Hello E-R-R");
W3sicHJvYmxlbV9pZCI6IjY2MTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJjODRcdWFkZjhcdWM3YTFcdWIyOTQgXHVhZmNkIiwiZGVzY3JpcHRpb24iOiI8cD48aW1nIGFsdD1cIlwiIHNyYz1cIlw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ycmVuY2Ugb2YgQi4gTm90aGluZyBlbHNlIG1heSBiZSByZW1vdmVkLCBub3QgZXZlbiBzcGFjZXMuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ICPC > Regionals > Europe > Central European Regional Contest > CTU Open Contest > CTU Open Contest, 2012 B번

  • 잘못된 번역을 찾은 사람: jh05013
  • 문제를 번역한 사람: seok9311