请注意,虽然在正式题面中,这题的输出不区分大小写,但是,受限于SPJ的必要性,在同步赛上,本题的输出将严格匹配大小写,请注意以免造成不必要的罚时 As the Avengers and their allies have continued to protect the world from threats too large for any one hero to handle,
请注意,虽然在正式题面中,这题的输出不区分大小写,但是,受限于SPJ的必要性,在同步赛上,本题的输出将严格匹配大小写,请注意以免造成不必要的罚时 As the Avengers and their allies have continued to protect the world from threats too large for any one hero to handle, a new danger has emerged from the cosmic shadows: Thanos. A despot of intergalactic infamy, his goal is to collect all six Infinity Stones, artifacts of unimaginable power, and use them to inflict his twisted will on all of reality. Everything the Avengers have fought for has led up to this moment-the fate of Earth and existence itself has never been more uncertain. During this war, the battle of the earth takes place in Wakanda, Black Panther and Captain America will lead superheroes to resist the Black Order.The infantry, led by captain, formed a defensive network in which there could be an undirected energy membrane between any two soldiers,because the fighting is so intense, the energy membrane may be destroyed at some point and then reborn at some point.Want to beat Thanos’ corporation, at any time Captain America need to know the status of the every soldier on the battlefield, such as how many people are there in the energy area Black widow belongs to,and whether any two soldiers are in the same energy area.Energy area is a subset of soldiers, in which any two soldiers can be connected directly or indirectly through the energy membrane,this task is a bit complicated, so captain wants you, Dr. Banner who has seven doctorates to help him finish this job, you will be fighting the Black Dwarf later, so please solve the problem as soon as possible.