Logo
(追記) (追記ここまで)

18927번 - Integer Equation Checker 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB62242150.000%

문제

In this task you need to create a checker for integer equations with error correction.

The integer equation is given in the form:

<number1><operation><number2>=<number3>

wherein "<numberI>" denotes any positive integer less than or equal to 10ドル^9$ without leading zeros, and "<operation>" is one of the signs '+', '-', '*' or '/' that represents one of the four basic math operations (note that unary plus and unary minus are not allowed). An expression that satisfies these properties is called well-formatted.

The checker shall read the equations and give the outcome in the next way:

  • Correct --- a well-formatted mathematically correct equation is given.
  • Format Error --- the given equation does not match the default format.
  • Typo: <equation1> instead of <equation2> --- the given equation (<equation1>) is well-formatted but not mathematically correct and is is enough to replace up to two characters in it to obtain a mathematically correct and well-formatted equation (<equation2>).
  • Math Error --- the given equation is well-formatted, mathematically incorrect, and it is impossible to correct two or less characters and obtain a well-formatted and mathematically correct equation.

Note that characters can be only replaced, they cannot be inserted or deleted.

입력

The first line of the input contains a non-empty string of up to 30 characters that represents the equation to be checked. This word consists only of decimal digits ('0' - '9'), arithmetic operators ('+', '-', '*', and '/') and equality signs ('=').

출력

Print the result of evaluation. Refer to the samples for clarity.

제한

예제 입력 1

2-2=0

예제 출력 1

Format Error

예제 입력 2

7/2=3

예제 출력 2

Typo: 7/2=3 instead of 6/2=3

예제 입력 3

2*2=47

예제 출력 3

Math Error

예제 입력 4

239*2=237

예제 출력 4

Typo: 239*2=237 instead of 239-2=237

예제 입력 5

112*11=13

예제 출력 5

Math Error

예제 입력 6

1000000000+たす3=1000000003

예제 출력 6

Format Error

예제 입력 7

2*2=4

예제 출력 7

Correct

힌트

출처

Camp > Bytedance-Moscow Workshops Camp > Bytedance-Moscow Workshops Camp 2020 > Contest 1 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /