시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB15813312086.331%

문제

Little Elrond is obsessed with the Lord of the Rings series. Between lectures he likes to doodle the central tower of the great fortress Baraddûr in the margins of his notebook. Afterward, he always double checks his drawings to ensure they are accurate: with the Eye of Sauron located in the very center of the tower. If any are incorrect, he makes sure to fix them.

You are to write a program that reads a representation of his tower, and ensures that the drawing is correct, with a properly centered eye.

입력

Input consists of a single string of length $n$, where $4 ≤ n ≤ 100$. Input strings will consist only of three types of characters: vertical bars, open parentheses, and closing parentheses. Input strings contain one or more vertical bars followed by a set of matching parentheses (the “eye”), followed by one or more vertical bars. For a drawing to be “correct”, the number of vertical bars on either side of the “eye” must match. Input will always contain a pair of correctly matched parentheses, with no characters between them. No other characters will appear in the string.

출력

On a single line print the word “correct” if the drawing is accurate or the word “fix” if there is an error that needs addressing.

예제 입력 1

|()||

예제 출력 1

fix

예제 입력 2

||||()||||

예제 출력 2

correct

예제 입력 3

|()|

예제 출력 3

correct

예제 입력 4

|||()|

예제 출력 4

fix

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2021 E번

  • 문제를 만든 사람: Joshua T. Guerin, Kathleen Ericson