No.1439 Let's Compare!!!!
Problem Statement
You are given $N$-digit non-negative integers $S,T$ in decimal notation, and $Q$ queries. In the $i$-th query, change the $x_i$-th digit from the top of the integer $c_i$ to $y_i$, then compare the magnitudes of $S,T$. Note that the change made in each query is not reverted when the query ends and continues to apply to subsequent queries (see the samples for details).
Input
$N$ $S$ $T$ $Q$ $c_1\ x_1\ y_1$ $c_2\ x_2\ y_2$ $\vdots$ $c_Q\ x_Q\ y_Q$
- All numbers in the input are integers
- $1 \le N,Q \le 2 \times 10^5$
- $S,T$ are $N$-digit non-negative integers in decimal notation
- $S,T$ may contain leading zeros, both in the input and at the end of each query
- $c_i$ is either
SorT - $1 \le x_i \le N$
- $0 \le y_i \le 9$
Output
After each query, print > if $S > T$, = if $S = T$, and < if $S < T$, followed by a newline.
Sample
Sample 1
Input
5 45218 08809 4 T 1 3 S 1 2 T 1 2 T 4 6
Output
> < < <
The operations change $(S,T)$ as follows: $(45218,08809) → (45218,38809) → (25218,38809) → (25218,28809) → (25218,28869)$.
Sample 2
Input
20 40565756273027673892 10905458842553731367 20 S 1 9 T 5 5 S 19 8 T 12 3 S 20 9 S 9 9 S 1 3 S 1 0 S 1 5 T 19 7 S 2 9 T 18 7 T 20 0 S 5 7 T 1 5 T 11 3 T 5 3 S 1 1 S 1 1 S 10 6
Output
> > > > > > > < > > > > > > > > > < < <
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。