logo AlgoBeat OnlineJudge
登录 注册

#213784. [NWERC 2023] Exponentiation

内存限制:2048 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

In her spare time, Zoe develops an online calculator. Unfortunately, the calculator was targeted by a denial-of-service attack last week. The attacker created a lot of integer variables, exponentiated them with each other, and tried to do a bunch of comparisons. The huge integers were too much for the server to handle, so it crashed. Before Zoe fixes the issue, she decides to actually perform the calculations that the attacker requested.

图片太大了传不上洛谷

:::align{center} Image by callmetak on Freepik :::

There are integer variables . At the start, each variable is set to . You have to perform instructions of the following two types:

  • Operations, of the form "", where . This means that gets set to .
  • Queries, of the form "", where . This means that you should print '' if is greater than , '' if is equal to , and '' if is smaller than .

Consider the first sample. After the operations, the values of the variables are:

输入格式

The input consists of:

  • One line with two integers and (, ), the number of variables and the number of instructions.
  • lines, each containing a character (either '' or '') and two integers and (, ), describing the instructions.

输出格式

For every query in the input, output its answer.

样例

样例输入 1

4 8
! 1 4
! 2 1
! 4 3
! 1 4
! 2 3
? 3 4
? 2 4
? 2 1

样例输出 1

<
>
=

样例输入 2

4 9
! 2 4
! 1 2
? 3 1
? 1 2
! 2 3
? 1 2
! 1 3
! 3 2
? 1 3

样例输出 2

<
>
>
<