Ant Trip Problem Description Ant Country consist of N towns.There are M roads connecting the towns. Ant Tony,together with his friends,wants to go through every part of the countr
In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There
Some company is going to hold a fair in Byteland. There are nn towns in Byteland and mm two-way roads between towns. Of course, you can reach any town from any other town using roads. There are kk types of goods produced in Byteland and every town produce
题目链接 \(Description\) 给定一棵\(Trie\)。求\(Trie\)上所有回文串 长度乘以出现次数 的和。这里的回文串只能是从上到下的一条链。 节点数\(n\leq 2\times 10^6\),字符集为a,b,c,d。 \(Solution\) 如果不是树,就是回文树模板。对于树,DFS \(x\)的每个儿子的时候都用在\(x\)处的\(
Description A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and puncture the truck's fuel tank. The truck now leaks one unit of fuel ever