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

30550번 - Scientific Grading 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB765100.000%

문제

You recently started working as a TA (teaching assistant) for your university's Scientific Computing class.

Today, Professor introduced the scientific notation, where numbers are written in the form $m \times 10^n$ with a real number $m$ (the significand) and an integer $n$ (the exponent).

At the end of class, she gave students the following assignment.

Given two numbers $x,ドル $y$ in scientific notation, perform the following four arithmetic operations:

  • $x + y$
  • $x - y$
  • $x \times y$
  • $x / y$

As a strict grader, you decided to write a program to grade students' answers.

You mark a solution correct if and only if both relative and absolute errors are less than 10ドル^{-9}$ (not including 10ドル^{-9}$).

If the correct answer is 0ドル,ドル then 0ドル$ is the only acceptable answer.

Otherwise, a student's answer $z$ will be compared to the correct answer $\tilde{z},ドル and the relative and absolute errors are computed as $\frac{|z - \tilde{z}|}{|\tilde{z}|}$ and $|z - \tilde{z}|,ドル respectively.

입력

The first line of input contains the value of $x,ドル and the second line contains the value of $y$.

The next four lines contain a student's answer to $x+y,ドル $x-y,ドル $x \times y,ドル and $x/y$.

All numbers are in the form of <SIGNIFICAND>e<EXPONENT>. The significand $m$ starts with a sign (+ or -), followed by one digit, a period (.), and exactly nine digits.

The exponent $n$ also starts with a sign (+ or -) and is followed by an integer between 0ドル$ and 10ドル^9,ドル inclusively.

The value is computed by $m \times 10^n$.

The value 0ドル$ is always represented as +0.000000000e+0, and for any nonzero values the first digit of their significand is not 0ドル$.

It is guaranteed that $x$ and $y$ are both nonzero.

출력

For each student solution, output Correct if it is considered correct and Incorrect otherwise. The first line of output indicates if the student's solution to $x+y$ is correct, the second line indicates if their solution to $x-y$ is correct, the third line indicates if their solution to $x \times y$ is correct, and the fourth line indicates if their solution to $x/y$ is correct.

제한

예제 입력 1

+2.000000000e+1
+3.000000000e+2
+3.200000000e+2
-2.800000000e+2
+6.000000000e+3
+6.666666667e-2

예제 출력 1

Correct
Correct
Correct
Correct

예제 입력 2

+1.000000000e-1
+1.000000000e-1
+2.000000003e-1
+1.000000000e-18
+1.000000002e-2
+1.000000001e+0

예제 출력 2

Incorrect
Incorrect
Incorrect
Incorrect

힌트

출처

ICPC > Regionals > North America > North Central North America Regional > 2023 North Central NA Regional Contest K번

ICPC > Regionals > North America > Rocky Mountain Regional > 2023 Rocky Mountain Regional Contest H번

  • 문제를 만든 사람: Yosuke Mizutani
(追記) (追記ここまで)

출처

대학교 대회

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

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