这场比赛是亚洲区比赛回来之后打得比较正经的一次个人赛,同时也暴露出了我最近精力及其的不集中,做事情非常的没有条理。非常的没有耐心,需要冷静下来。
Problem B
There are some beautiful girls in Arpa’s land as mentioned before.
Once Arpa came up with an obvious problem:
Given an array and a number x, count the number of pairs of indices i, j (1 ≤ i < j ≤ n) such that , where is bitwise xor operation (see notes for explanation).
这一题,充分暴露了我做事十分不专心的特点,我一看,就想到了下面的公式:
a
n
s
=
∑
0
n
n
u
m
[
i
]
∗
n
u
m
[
x
x
o
r
i
]
但是,这个排列组合公式什么时候可以用啊,是在两个要做笛卡尔积的集合没有交集的时候才能使用啊,如果x=0,那么这个公式很显然是错误的。
Problem C
Someday Arpa shouted Owf loudly from the top of the palace and a funny game started in Arpa’s land. The rules are as follows.
The game consists of rounds. Assume person x wants to start a round, he calls crushx and says: “Oww…wwf” (the letter w is repeated t times) and cuts off the phone immediately. If t > 1 then crushx calls crushcrushx and says: “Oww…wwf” (the letter w is repeated t - 1 times) and cuts off the phone immediately. The round continues until some person receives an “Owf” (t = 1). This person is called the Joon-Joon of the round. There can’t be two rounds at the same time.
Mehrdad has an evil plan to make the game more funny, he wants to find smallest t (t ≥ 1) such that for each person x, if x starts some round and y becomes the Joon-Joon of the round, then by starting from y, x would become the Joon-Joon of the round. Find such t for Mehrdad if it’s possible.
Some strange fact in Arpa’s land is that someone can be himself’s crush (i.e. crushi = i).
这道题,由体现出来我做事十分没有耐心,如果将每个人当作一个节点的话,那么每个节点的出度为1,如果存在一个节点没有入度的话,那么肯定题目无解,我们从每一个节点出发DFS这个连通分支,如果不可以返回这个节点,那么表明无解。如果得到一个奇数长度的环,则说明需要奇数长度,否则需要偶数长度的一半。
Problem D
Just to remind, girls in Arpa’s land are really nice.
Mehrdad wants to invite some Hoses to the palace for a dancing party. Each Hos has some weight wi and some beauty bi. Also each Hos may have some friends. Hoses are divided in some friendship groups. Two Hoses x and y are in the same friendship group if and only if there is a sequence of Hoses a1, a2, …, ak such that ai and ai + 1 are friends for each 1 ≤ i < k, and a1 = x and ak = y.
Arpa allowed to use the amphitheater of palace to Mehrdad for this party. Arpa’s amphitheater can hold at most w weight on it.
Mehrdad is so greedy that he wants to invite some Hoses such that sum of their weights is not greater than w and sum of their beauties is as large as possible. Along with that, from each friendship group he can either invite all Hoses, or no more than one. Otherwise, some Hoses will be hurt. Find for Mehrdad the maximum possible total beauty of Hoses he can invite so that no one gets hurt and the total weight doesn’t exceed w.
这道题更加的搞笑,首先我的并查集居然写错了,完全忘记了合并并查集就是合并并查集的根节点。然后做背包转移的时候实际上就是将某个并查集打包成一个物品转移进去。然而我想的太过复杂,代码写的乱七八糟,看着我很想笑。
检讨
我本来以为,亚洲区赛是一个开始,新生活的开始,我可以更加开心,更有自信。但是,我发现我的心态发生了很大的变化,变得完全没有从前那么快乐了。我还记得之前我经历过的一切的一切。我还记得暑假我每天往返于实验室,拼命的看论文时的场景。虽然每天都是那么累,但是又有什么可以记得的呢?我还记得我一个人回寝室的路上,一遍一遍听着的那首歌“永远不要盲目追星,长大后的你可能比他还行”。我想要享受生活中所有美好的部分,实现内心最底层的愿望。
但是,现在,一切都变了。亚洲赛回来之后,我再也没有从前的那么低调了。各种的盲目称赞麻痹了我的双眼,让我忘记了天的那边还有着更大的世界。我变得没有那么努力了,说话也不在像从前那么谦逊。变得无趣和无聊。做事情一点条理也没有,写的代码我自己都不忍心再看。看看那些大牛们,我觉得,我为我所做的所有的事情而感到害臊。
不管怎么样,现在还来得及。回归当初的美好,做一个快乐的孩子。