Little E is a senior magic enthusiast. Recently, he has harvested a batch of magic puzzles. After arranging these puzzles in a row, he found that these puzzles can be operated in 333 ways: 1. You can select any two separate puzzles to connect them together. 2. You can select an interval of any size to connect all the puzzles in the interval. 3. Query any two puzzles. Puzzles are numbered from 111 to nnn. When Little E operates in 333, he wants to know whether the two specified puzzles are connected. Please tell him.
Little E is a senior magic enthusiast. Recently, he has harvested a batch of magic puzzles. After arranging these puzzles in a row, he found that these puzzles can be operated in 333 ways: 1. You can select any two separate puzzles to connect them together. 2. You can select an interval of any size to connect all the puzzles in the interval. 3. Query any two puzzles. Puzzles are numbered from 111 to nnn. When Little E operates in 333, he wants to know whether the two specified puzzles are connected. Please tell him.
标签: HBC244914名作之壁 数据结构 单调队列单调栈 枚举 尺取法Little E's Magic Puzzles题解