摘要:题目这个题有一个挺坑的误区,不是统计字符串中出现的所有字符的个数,而是统计相邻的个数刚开始就写错了正解:#include #include int main(){ int n,i,num; char str[10001]; scanf("%d",&n...
阅读全文
12 2017 档案
摘要:题目这道题是个水题,写博客上的人好像都不屑于写这这道题。但是我为什么还是觉得挺难的呢? 我也是看了别人的博客才过了的,感觉这种写法很新颖,这样就可以不用在排序了。下面给出正解:#include#includeusing namespace std;int S[1000...
阅读全文
摘要:1506题目1505题目1506:#include#include#includeusing namespace std;const int Max = 100010;int main(){ int n; long long num[Max],temp; ...
阅读全文
摘要:题目我们用dp[n]表示用这些硬币组成n的方法总数。。。。然后随着硬币种类的增加来更新dp[]的值,也就是最外面的一层循环for(i :1-->3)开始初始化的时候没有硬币,然后新来了面值为1的硬币,接着又来了面值为2的硬币。。。。显然,每新增加一种面值的硬币,dp[...
阅读全文