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

26034번 - Keyboard Queries 다국어

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

문제

Katrín and her friends are university students, and they go to a seminar every week. At the start of each seminar, the professor divides the students into groups randomly. Katrín and her friends dislike random groups, they want to form a group together so they can chat with each other and not get to know the other students. The professor has a secret string $S$ consisting of $n$ characters on their computer. This string acts as a seed for the random group generation. When generating groups, a program manager is ran with a substring of $S$ as input. But sometimes, the professor mistypes and writes manacher instead. This will indicate that the substring is a palindrome. Maybe Katrín can use this information to predict what the group division will look like?

There is a secret string $S$ with $n$ characters in an unknown alphabet. You are given $q$ queries of two types.

  • 1 l r: This means that the substring of $S$ at indices $l$ through $r$ is a palindrome.
  • 2 a b x y: This means that you should determine whether the substring at indices $a$ though $b$ is equal to the substring at indices $x$ through $y,ドル given the information in the previous queries.

입력

The first line of input contains two integers $n$ and $q$ (1ドル \leq n \leq 10^5,ドル 1ドル \leq q \leq 2 \cdot 10^5$), the number of characters in the unknown string and the number of queries.

The following $q$ lines each start with a 1ドル$ or a 2ドル$ indicating the type of query. For queries of type 1ドル,ドル two integers $l$ and $r$ follow (1ドル \leq l \leq r \leq n$), meaning that the corresponding substring of $S$ is a palindrome. For queries of type 2ドル,ドル four integers $a,b,x,y$ follow (1ドル \leq a \leq b \leq n,ドル 1ドル \leq x \leq y \leq n$), meaning that you should determine whether those two substrings are equal or not.

출력

For each query of the second kind print "Equal" if the substrings must be equal, "Not equal" if the substrings can't be equal, and "Unknown" if either possibility could be true given the information thus far.

제한

예제 입력 1

6 8
1 1 6
2 1 1 6 6
2 1 2 5 6
2 1 3 5 6
1 1 3
2 1 3 4 6
2 4 4 6 6
2 2 3 4 5

예제 출력 1

Equal
Unknown
Not equal
Equal
Equal
Unknown

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2022 K번

  • 문제를 만든 사람: Atli Fannar Franklín
(追記) (追記ここまで)

출처

대학교 대회

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

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