#P8943. Deception Point

    ID: 9964 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>2023洛谷原创O2优化最短路基环树

Deception Point

Background

“The air defense fire net is online.” Delta Two shouted. Sitting in the weapon control seat by the door of the “Kiowa” armed helicopter, he raised his thumb. “The fire net, modulated noise, and cover pulses are all activated and locked.”

Delta One understood at once. He jerked the aircraft into a sharp right bank, and the aircraft returned to a straight route toward “Goya.” This move could avoid “Goya”’s radar surveillance.

“Chaff pack confirmed!” Delta Two shouted.

Absolute isolation,

Delta One thought.

They have no resistance at all.

Their targets had escaped from the Milne Ice Shelf, lucky and cunning, but this time they would not get away again. Rachel Sexton and Michael Tolland chose to abandon the shore and board the ship, a terrible choice. But this would be the last bad decision they ever made.

Problem Description

Rachel and Michael are trapped on the “Goya,” and Delta Two is hunting them by following the radar. Luckily, Rachel also has a radar, so both sides can know each other’s positions.

Inside the ship there are nn rooms, and there are nn corridors connecting these rooms. The nn rooms are connected to each other. Because the ship is cramped, there will be no cycles of length at most 44 inside the ship. Every minute, Rachel and Delta Two will simultaneously run from one room to another room.

If Rachel encounters Delta in a room or on a corridor, it means the end is near. Rachel has a total of qq questions: when she is in room xx and Delta Two is in room yy, can she survive?


[Formal Statement]

Given an undirected connected graph with nn vertices and nn edges, and there are no cycles of length 44 (or less). There are qq queries x,yx, y. Place two tokens A,B\rm A, B on vertices x,yx, y of the graph.

In each turn, both players simultaneously move their token one step along an edge. If the two tokens move to the same vertex at the same time, or traverse the same edge at the same time, then B\rm B wins. If after 1010996110^{10^{9961}} turns B\rm B still has not won, then A\rm A wins.

Both A\rm A and B\rm B are extremely smart, and they will not make decisions that are bad for themselves. Please determine the result of each game. If A\rm A wins, output Survive; otherwise output Deception.

If you have questions about the statement, please refer to the sample explanation and the Constraints section.

Input Format

The first line contains two integers n,qn, q.
The next nn lines each contain two integers ui,viu_i, v_i, indicating that there is a corridor between room uiu_i and room viv_i.
Then follow qq lines, each containing two integers xi,yix_i, y_i, indicating one query.

Output Format

Output qq lines. For each query, if Rachel can survive, output Survive; otherwise output Deception.

8 3
2 1
3 1 
4 2 
5 3
6 2
7 5
8 4
5 6
7 8
8 6
3 6
Survive
Deception
Survive

Hint

[Sample Explanation]

The ship cabin graph is as follows:

In the second query, Delta can move first to vertex 22, while Rachel moves to vertex 44. Then it can be proven that there is no strategy that allows Rachel to avoid encountering Delta.

[Constraints]

This problem uses bundled testdata.

Subtask\text{Subtask} Score nn\le qq\le Special Property
00 55 2×1052\times10^5 11 None
11 1010 2×1052\times10^5
22 2×1052\times 10^5 1in,ui=i,vi=(imodn)+1\forall 1\le i\le n, u_i=i,v_i=(i\bmod n) + 1
33 1515 200200 2×1052\times 10^5 None
44 2020 2×1032\times 10^3
55 5050 2×1052\times 10^5

For 100%100\% of the data, 3n2×1053\le n\le 2\times10^5, 1q2×1051\le q\le2\times10^5, uiviu_i\neq v_i, xiyix_i\neq y_i. There are no cycles of length 44 (or less).

Translated by ChatGPT 5