시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 154 42 41 36.937%

문제

당신 친구 지민이는 지금 할 일이 없다. 그리고 매우 심심하다. 그래서 쓸데없는 짓으로 시간을 때우려고 한다.

그래서 단어 하나가 주어질 때 단어에 'lol'이 들어가도록 글자를 추가하거나 변경하거나 삭제하는 쓸데없는 프로그램을 작성하려고 한다. 하지만 지민이는 갑자기 다른 쓸데없는 다른 프로그램을 작성하고 싶어졌다.

그래서 당신도 할 일이 없기 때문에 지민이의 프로그램을 대신 작성할 것이다.

하지만 당신은 지민이보다 프로그래밍을 못하기 때문에 추가/삭제/변경할 글자수의 최솟값을 출력해야 한다.

입력

첫 번째 줄에 테스트케이스의 수 T(0 < T ≤ 100)가 주어진다.

두 번째 줄부터 T+1번째 줄까지 단어가 하나씩 주어진다. 단어는 영어 소문자로만 이루어져 있다. 단어의 최대 길이는 50글자이다.

출력

i번째 줄에 해당 단어에 몇 개의 글자를 추가/수정/삭제해야 'lol'이라는 부분 문자열이 생기는지 출력하라.

예제 입력 1

4
fotball
sopp
ingenting
spillolje

예제 출력 1

1
2
3
0
W3sicHJvYmxlbV9pZCI6IjExMTQwIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiTE9MIiwiZGVzY3JpcHRpb24iOiI8cD5cdWIyZjlcdWMyZTAgXHVjZTVjXHVhZDZjIFx1YzljMFx1YmJmY1x1Yzc3NFx1YjI5NCBcdWM5YzBcdWFlMDggXHVkNTYwIFx1Yzc3Y1x1Yzc3NCBcdWM1YzZcdWIyZTQuIFx1YWRmOFx1YjlhY1x1YWNlMCBcdWI5ZTRcdWM2YjAgXHVjMmVjXHVjMmVjXHVkNTU4XHViMmU0LiBcdWFkZjhcdWI3OThcdWMxMWMgXHVjNGY4XHViMzcwXHVjNWM2XHViMjk0IFx1YzlkM1x1YzczY1x1Yjg1YyBcdWMyZGNcdWFjMDRcdWM3NDQgXHViNTRjXHVjNmIwXHViODI0XHVhY2UwIFx1Z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BvbiBpdHMgb3duIGxpbmUgdGhlIG1pbmltdW0gbnVtYmVyIG9mIGNoYW5nZXMgbmVlZGVkIGluIG9yZGVyIHRvIG9idGFpbiBhIHN0cmluZyBjb250YWluaW5nIDxjb2RlPmxvbDxcL2NvZGU+IGFzIGEgc3Vic3RyaW5nLjxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

Contest > IDI Open Contest > IDI Open 2011 C번

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