![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
思维
文章平均质量分 62
Zhac
菜菜菜
展开
-
zzulioj1899 985的最大和难题(思维)
Description985有2 * n - 1个整数,他每次可以将其中n个数变号,操作次数不限,问他可以得到的最大和。Input第一行输入一个整数t,代表有t组测试数据。每组数据占两行,第一行输入一个整数n,下面一行输入2*n-1个整数a[]。注:1 Output输出一个整数代表可以得到的最大和。Sample Input221 1原创 2016-08-10 11:53:19 · 312 阅读 · 0 评论 -
zzulioj1895: 985的0-1串难题(思维)
Description985有一个长度为n的0-1串,已知他最多可以修改k次(每次修改一个字符即0->1 或者 1->0),他想知道连续的全1子串最长是多少。Input第一行输入一个整数t,代表有t组测试数据。每组数据第一行输入两个整数n,k分别代笔上面的信息。注:1 Output一个整数代表可以得到的最大长度。Sample Input2原创 2016-08-09 20:16:43 · 454 阅读 · 0 评论 -
zzulioj1898 985的数字难题(思维)
Description985有n个数,已知每次操作可以将其中不相同的两个数一个加一、一个减一,操作次数不限。问他最多可以得到多少个相同的数。Input第一行输入一个整数t,代表有t组测试数据。每组数据占两行,第一行输入一个n代表元素个数,下面一行输入n个整数a[]。注:1 Output输出一个整数代表最多可以得到多少个相同的数。Sample In原创 2016-08-03 18:31:37 · 296 阅读 · 3 评论 -
CodeForces 554BOhana Cleans Up(思维)
DescriptionOhana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the原创 2016-08-23 09:58:40 · 314 阅读 · 0 评论 -
CodeForces 632BAlice, Bob, Two Teams
DescriptionAlice and Bob are playing a game. The game involves splitting up game pieces into two teams. There are n pieces, and the i-th piece has a strength pi.The way to split up game pieces i原创 2016-08-23 10:10:38 · 225 阅读 · 0 评论 -
LightOJ1104Birthday Paradox(思维+数学)
DescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is th原创 2016-08-15 11:28:27 · 316 阅读 · 0 评论