[Huawei OD Unified Exam B Paper | 100 points] Message loop (C++ Java JavaScript Python)

Online OJ

Users who have already purchased this column, please private message the blogger to open an account and brush up questions online! ! !

Online OJ: brush the questions immediately

Question bank column: 2023 Huawei OD machine test (A volume + B volume) (C++JavaJSPy)

topic description

In the IGMP protocol, the response message and the query message are two important messages to maintain the multicast channel. In an established multicast channel, two adjacent HOST and ROUTER, the ROUTER will send the query message to the HOST, After HOST receives the query message, it will reply a response message to ROUTER to maintain the relationship between phases. Once the relationship is broken, this multicast channel will be abnormal. Now, by some means, the HOST and All the response packets and query packets communicated by ROUTER, please analyze whether the multicast channel is "normal"

enter description

The number of packets captured in the first line is C (C≤100), and the subsequent C lines are input to device nodes D1 and D2 in turn, indicating that a one-way packet is sent from D1 to D2, and D1 and D2 are separated by spaces.

output description

Whether the multicast channel is "normal", output True when normal, and output False when abnormal.

use case 1

enter

5
1 2
2 3
3 2
1 2
2 1

output

True

use case 2<

Guess you like

Origin blog.csdn.net/shangyanaf/article/details/131749132