焫鷄来献题

AT_arc083_d [ARC083F] Collecting Balls

麻麻呀,走错位置了。。
by HDGS @ 2018-08-01 15:17:09


号外,这个才是正确题解。。 xy平面中有2N个球。它们的第i个坐标是(xi,yi)。这里,对于所有i,xi和yi是1和N(包括)之间的整数,并且没有两个球占据相同的坐标。 为了收集这些球,Snuke准备了2N机器人,N型A型和N型B.然后,他将A型机器人放置在坐标(1,0),(2,0),...,(N, 0)和坐标(0,1),(0,2),...,(0,N)处的B型机器人,每个位置一个。 激活后,每种类型的机器人将按如下方式运行。 当在坐标(a,0)处激活A型机器人时,它将移动到球x = a上的球中具有最低y坐标的球的位置,收集球并停用自身。如果没有这样的球,它只会在没有做任何事情的情况下自行停用。 当在坐标(0,b)处激活B型机器人时,它将移动到球y = b的球中具有最低x坐标的球的位置,收集球并停用自身。如果没有这样的球,它只会在没有做任何事情的情况下自行停用。 停用后,无法再次激活机器人。此外,在机器人运行时,在操作机器人停用之前,不能激活新的机器人。 当Snuke即将激活一个机器人时,他注意到他可能无法收集所有的球,这取决于激活机器人的顺序。 在(2N)中!激活机器人的可能的顺序,找到那些使得所有的球可以收集的1 000 000 007数模 约束 2≤N≤10^5 1≤xi≤N 1≤yi≤N 如果i≠j,则xi≠xj或yi≠yj。 输入 输入由标准输入以下列格式给出: N x1 y1 ... x2N y2N 输出 打印激活机器人的订单数量,以便可以收集所有球,模数为1 000 000 007。
by HDGS @ 2018-08-01 15:19:25


英语翻译(中石油比赛英文翻译搬运) 题目描述 There are 2N balls in the xy-plane. The coordinates of the i-th of them is (xi,yi). Here, xi and yi are integers between 1 and N (inclusive) for all i, and no two balls occupy the same coordinates. In order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B. Then, he placed the type-A robots at coordinates (1,0),(2,0),…,(N,0), and the type-B robots at coordinates (0,1),(0,2),…,(0,N), one at each position. When activated, each type of robot will operate as follows. When a type-A robot is activated at coordinates (a,0), it will move to the position of the ball with the lowest y-coordinate among the balls on the line x=a, collect the ball and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything. When a type-B robot is activated at coordinates (0,b), it will move to the position of the ball with the lowest x-coordinate among the balls on the line y=b, collect the ball and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything. Once deactivated, a robot cannot be activated again. Also, while a robot is operating, no new robot can be activated until the operating robot is deactivated. When Snuke was about to activate a robot, he noticed that he may fail to collect all the balls, depending on the order of activating the robots. Among the (2N)! possible orders of activating the robots, find the number of the ones such that all the balls can be collected, modulo 1 000 000 007. Constraints 2≤N≤105 1≤xi≤N 1≤yi≤N If i≠j, either xi≠xj or yi≠yj. 输入 Input is given from Standard Input in the following format: N x1 y1 … x2N y2N 输出 Print the number of the orders of activating the robots such that all the balls can be collected, modulo 1 000 000 007.
by HDGS @ 2018-08-01 15:45:08


不好意思哈,第一次写,不太明白那么多条条,现在看来,自己挺蠢的,请忽略吧。。不好意思了各位。英文比较权威,汉字是机翻,以前不懂,麻烦了,自觉忽略吧,给跪了
by HDGS @ 2018-08-10 15:57:14


|