65536K   Teemo is very interested in convex polygon. There is a convex n-sides polygon, and Teemo connect every two points as diagonal lines, and he want to kown how many segments which be divided into intersections. Teemo ensure that any three diago…
ACM训练联盟周赛 这一场有几个数据结构的题,但是自己太菜,不会树套树,带插入的区间第K小-替罪羊套函数式线段树, 先立个flag,BZOJ3065: 带插入区间K小值 计蒜客 Zeratul与Xor 赛后知道这是个01字典树的题目(嘤嘤嘤???) 这一场写了两道(具体来说就一道)就开溜了,但是计蒜客上这个比赛貌似没有赛后补题,但是有差不多的题目,所以去补那些题就可以了. 有题库链接,可以补题了. G. 算个欧拉函数给大家助助兴 这个题和上一场的 F.Divisions,其实就是一样的题目,代码…
65536K   Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teacher that the problems in the homework are too simple to solve. So the teacher gets much angrier an…
Teemo likes to drink raspberry juice.  He even spent some of his spare time tomake the raspberry juice himself. The way to make the raspberries juice is simple. You just have to press the raspberries through a fine sieve. Unfortunately,today Teemo wa…
助手Christina发明了一种方格取数的新玩法:在n*m的方格棋盘里,每个格子里写一个数.两个人轮流给格子染色,直到所有格子都染了色.在所有格子染色完后,计算双方的分数.对于任意两个相邻(即有公共边)的格子,如果它们都被同一个人染色,那么这个人将得到这两个格子中的数的异或的分数.所有的分数加和计算. 现在,Christina用这个游戏来挑战你,想让你一败涂地,因此她总是采用最优策略使得她的分数尽可能地比你多.为了不输得太惨,你需要知道自己最多比助手多多少分数,或最少比助手少多少分数——也就是你…
题目描述 ggwdwsbs最近被Zeratul和Kyurem拉入了日本麻将的坑.现在,ggwdwsbs有13张牌,Kyurem又打了一张,加起来有14张牌.ggwdwsbs想拜托你帮他判断一下,这14张牌能否和. 为了方便起见,本题不考虑字牌,即只有万,筒,条三种类型的牌,牌上带有数字1~9,相同的牌最多可能出现四次. 麻将想要和,必须把14张牌凑成指定的类型——七对子(2222222的形式)或四面子一雀头(23333的形式). 其中,七对子是指14张牌恰好是7对相同的牌(每两对牌不得相同),如…
题目描述 众所周知,Alice和Bob非常喜欢博弈,而且Alice永远是先手,Bob永远是后手. Alice和Bob面前有3堆石子,Alice和Bob每次轮流拿某堆石子中的若干个石子(不可以是0个),拿到所有石子中最后一个石子的人获胜.这是一个只有3堆石子的Nim游戏. Bob错误的认为,三堆石子的Nim游戏只需要少的两堆的石子数量加起来等于多的那一堆,后手就一定会胜利.所以,Bob把三堆石子的数量分别设为 {k,4k,5k}(k>0). 现在Alice想要知道,在k 小于 2^n 的时候,有多…
A.Teemo's bad day Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework.But Teemo is very self-confident, he tells the teacher that the problems in the homework are too simple to solve. So the teacher gets much a…
Teemo has a formula and he want to calculate it quickly. The formula is . As the result may be very large, please output the result mod 1000000007. Input Format The input contains several test cases, and the first line is a positive integer T indicat…
B:Zeratul与Xor 题目描述 Xor(按位异或),对应C++中的“^”运算符. Zeratul给出了一个数列A[n](n≤105),要做q(q≤105)组动作,这些动作包括: 1  a:数列中所有的元素异或上a.a非负,且不会超过int的范围. 2  b:向数列尾部添加一个新的数b.b非负,且不会超过int的范围 3  k:查询当前的数列中第k小的数,并输出这个数.保证k不会超过当前数列的长度. 输入 第一行包括两个元素n,q(1≤n≤105,1≤q≤1). 第二行包括n个数,代表初始的…