上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 60 下一页
摘要: 原题是CF上的某题,但是还要输出方案。。。。好鬼畜啊WWW 发现答案肯定是优先 xorsum^x1 + x1 最大,然后再优先x1最小(也就是 xorsum^x1 最大)。 我们把xorsum二进制分解一下,如果要让 xorsum^x1 + x1最大,那么肯定先得是 xorsum 为0的位 x1 在 阅读全文
posted @ 2018-05-28 21:39 蒟蒻JHY 阅读(622) 评论(0) 推荐(0) 编辑
摘要: Read problems statements in Mandarin Chinese and Russian. You are given an array that consists of n integer numbers. You have to change at most K elem 阅读全文
posted @ 2018-05-28 19:44 蒟蒻JHY 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Problem Statement There is a pond with a rectangular shape. The pond is divided into a grid with H rows and W columns of squares. We will denote the s 阅读全文
posted @ 2018-05-28 17:24 蒟蒻JHY 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Problem Statement There are N squares arranged in a row. The squares are numbered 1, 2, …, N, from left to right. Snuke is painting each square in red 阅读全文
posted @ 2018-05-28 16:31 蒟蒻JHY 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 挺不错的一道数据结构题QWQ。 一开始发现这个题如果不看数据范围的话,妥妥的树上莫队啊23333,然鹅10组数据是不可能让你舒舒服服的树上莫队卡过的23333 于是想了想,这个题的模型就是,把u到v链上的权值出现奇偶次的01串搞出来,然后第一个0的位置就是所求。。。。。 但是这个01串并不是很好搞, 阅读全文
posted @ 2018-05-28 11:32 蒟蒻JHY 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 非常nice的一道行列式的题目。 考虑如果没有路径不相交这个限制的话,那么这个题就是一个行列式:设 a[i][j] 为从编号第i小的源点到编号第j小的汇点的路径条数,那么矩阵a[][]的行列式就是的答案,因为行列式的定义就是给行一个列的排列,贡献就是所有a[i][p[i]]再乘上 (-1)^(p[] 阅读全文
posted @ 2018-05-27 20:40 蒟蒻JHY 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 把lcm写成 (a+n)*(b+n) / gcd(a+n,b+n). 因为gcd可以辗转相减,所以就成了gcd(abs(a-b),a+n),一个常量一个变量之间的gcd,我们可以直接把abs(a-b)的所有约数找出来,然后看a要有某个约数的话n至少是多少,更新答案即可。(因为1e9以下的数的最多的约 阅读全文
posted @ 2018-05-27 19:50 蒟蒻JHY 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Discription Farmer John is hosting a tennis tournament with his n cows. Each cow has a skill level si, and no two cows having the same skill level. Ev 阅读全文
posted @ 2018-05-27 16:46 蒟蒻JHY 阅读(366) 评论(0) 推荐(0) 编辑
摘要: Problem Statement There is an integer sequence A of length N. Find the number of the pairs of integers l and r (1≤l≤r≤N) that satisfy the following co 阅读全文
posted @ 2018-05-27 11:04 蒟蒻JHY 阅读(331) 评论(0) 推荐(0) 编辑
摘要: Problem Statement There are N people standing in a row from west to east. Each person is facing east or west. The directions of the people is given as 阅读全文
posted @ 2018-05-27 10:30 蒟蒻JHY 阅读(359) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 60 下一页