| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 1024 MB | 175 | 37 | 32 | 22.222% |
This problem is interactive. Refer to the Interaction section below for a better understanding.
Today was the first class of CS999.
First, you have learned non-negative integer less than or equal to 4ドル \times 10^{18}$.
You have also learned the addition, subtraction, and comparison of two integers.
The homework is to compare two fractions $\frac{A}{B}$ and $\frac{C}{D}$. Professor told you that you can solve homework only using classroom materials.
You are only allowed to use the following operations:
By using these operations, you have to compare two fractions.
This subtask has an additional constraint:
Your program should satisfy:
This subtask has an additional constraint:
Your program should satisfy:
This subtask has an additional constraint:
Your program should satisfy:
This subtask has no additional constraint.
Your program should satisfy:
This subtask has no additional constraint.
Your program should satisfy:
This subtask has no additional constraint.
-1
+ 5 3 1 - 1 2 1 < 1 5 ! 0
For the first example, $A=1,ドル $B=1,ドル $C=2,ドル $D=2$. It satisfies the constraint of subtask 2,3,4,5,6.
1 -1 0
< 1 2 < 4 3 < 2 2 ! -1
For the second example, $A=1,ドル $B=2,ドル $C=3,ドル $D=4$. It satisfies the constraint of every subtask.
You cannot get $A,ドル $B,ドル $C,ドル nor $D$ directly in this problem.
Instead, you can use some operations to a hidden array of length 10ドル^6$; $X_1, X_2, \cdots, X_{10^6}$.
Initially, $X$ satisfies $X_1=A,ドル $X_2=B,ドル $X_3=C,ドル $X_4=D,ドル and $X_i=0$ for $i$ greater than 4ドル$.
You can use the following commands to do operations:
+ i j k" (1ドル \le i, j, k \le 10^6$). $X_i$ will be replaced with a value of $X_j+X_k$.Wrong Answer". Nothing will be given to the input.- i j k" (1ドル \le i, j, k \le 10^6$). $X_i$ will be replaced with a value of $X_j-X_k$.Wrong Answer". Nothing will be given to the input.< i j" (1ドル \le i, j \le 10^6$). A line containing one integer will be given to the input.
-1" will be given when $X_i<X_j$.0" will be given when $X_i=X_j$.1" will be given when $X_i>X_j$.After successfully comparing $\frac{A}{B}$ and $\frac{C}{D},ドル
! -1".! 0".! 1".If you ask more than 200ドル,001円$ commands or make an invalid query, the interactor will terminate immediately and your program will receive the verdict "Wrong Answer".
If your comparison is incorrect, your score will be 0ドル$.
Otherwise, the score of the program will be graded with three factors: