题意:给你一串非负整数,可以将一个非零数减1,加到相邻的数字上,要使其中所有最大数字的和最小。题解:模拟可以过。也可以分析,可以要减少最大数字和,如果最大数字出现大于等于3次,可以把最大数字加一,或者把某个最大数字减一,最大数字出现减少一次。但是药品注意一些特殊情况,下面详述。先扫一遍,如果最大数字...
分类:
其他好文 时间:
2015-07-25 18:08:18
阅读次数:
127
题意:给你n个点,将这些点放在一个环上,问你不相交的连k条线的方案数。(没有重点)题解:dp[i][j]表示i个点连j条线的方案数,那么新加一个点i,情况1,i没有和之前的点相连,方案数为dp[i-1][j];情况2,i和p号点相连(0#include#include#include#include...
分类:
其他好文 时间:
2015-07-25 18:06:49
阅读次数:
111
题意:给一个式子,ak,k>2时,0#include#include#include#include#includeusing namespace std;typedef unsigned long long ull;int main(){ ull p,q; scanf("%I64u%I...
分类:
其他好文 时间:
2015-07-25 18:03:10
阅读次数:
317
题解:读懂题意按照题意模拟。。。熟悉了一个库函数,strstr,memcpy#include#includeint main(){ int N; char str[150]; int cnt[3] = {0}; scanf("%d",&N); getchar(); fo...
分类:
其他好文 时间:
2015-07-25 18:02:10
阅读次数:
74
题意:给一个凸包,含有N个点,求删除每个点后再求凸包,凸包上的点的平均值。以p/q的最简形式输出,起初q=N。题目要求凸包不允许有两条相邻边平行。
链接:http://codeforces.com/gym/100492 A题解法:咋一看没啥思路,可能会想到枚举删除每个点,其左边的点到右边的点再求一次凸包 这样的方法,虽然复杂度依然是O(N)的,但是这样编码起来极其困难,而且容易写挂。多想一想,发现...
分类:
编程语言 时间:
2015-07-25 16:52:59
阅读次数:
404
F. The Pool for Lucky OnesTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100637/problem/FDescriptionA new swimming pool has been ...
分类:
其他好文 时间:
2015-07-25 01:41:16
阅读次数:
184
A. Nano alarm-clocksTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100637/problem/ADescriptionAn old watchmaker hasnstopped nano ...
分类:
其他好文 时间:
2015-07-25 00:12:55
阅读次数:
317
A. Nano alarm-clocksTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100637/problem/ADescriptionAn old watchmaker hasnstopped nano ...
分类:
其他好文 时间:
2015-07-24 20:38:45
阅读次数:
181
G. #TheDressTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100637/problem/GDescriptionAfter landing on planet i1c5l people notice...
分类:
其他好文 时间:
2015-07-24 20:34:51
阅读次数:
127
B. LunchTime Limit: 20 SecMemory Limit: 256 MB题目连接http://codeforces.com/gym/100637/problem/BDescriptionThe swamp looks like a narrow lane with length ...
分类:
其他好文 时间:
2015-07-24 20:21:41
阅读次数:
223