
水
文章平均质量分 50
asuxiexie
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
codeforces Div.2 B.Suffix Structures
题意是给我们两个字符串,再在第一个字符串中找第二个,给了我们两种方法,一:在第一个字符串删掉一些字符后得到第二个字符串;二:在第一个字符串中改变一些字符的先后顺序得到字符串二;如果只用第一种方法输出: automaton;只用第二种输出:array两种都用输出:both;找不到输出:need tree;直接找就行,,,,,,水#include#include原创 2014-07-18 09:02:02 · 706 阅读 · 0 评论 -
hud 2570 迷障(水 贪心)
对给的药水浓度进行排序,对于小于解毒药水浓度的可以直接加上它的体积,对每次混合后的药水浓度进行记录,大于解毒药水浓度就输出,注意你求得是百分比还是百分数。。。#include#include#include#includeusing namespace std;int s[10005];int main(){ int a,i,n,m,k; s原创 2014-08-01 16:06:48 · 740 阅读 · 0 评论 -
hdu 1800 Flying to the Mars(水 ,贪心)
其实就是求最大的相同的数的多少。。我是把它当字符串输入。。解决前导0的问题。。#include#include#include#includeusing namespace std;int main(){ char s[35]; int w[3500]; __int64 qq[3500]; int a; while(原创 2014-08-01 14:56:21 · 676 阅读 · 0 评论 -
hdu 2089 不要62
简单问题,直接将不吉利的车牌找出再用数组存起来;要注意 64 64输出1;63 64 输出也是1;因为只有1000000个数,因此可以直接打表#include#includeint s[1000001];int main(){ int i,j,a,b,e,f,c; s[0]=0; for(i=1;i<1000001;i++) { b=i; for(j=1;原创 2014-07-14 15:01:23 · 700 阅读 · 0 评论 -
A + B Problem
#includeint main(){ int a,b; while(~scanf("%d %d",&a,&b)) printf("%d\n",a+b); return 0;}原创 2014-05-11 12:13:28 · 487 阅读 · 0 评论 -
好老师
1334: 好老师Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 123 Solved: 56[Submit][Status][Web Board]Description我想当一个好老师,所以我决定记住所有学生的名字。可是不久以后我就放弃了,因为学生太多了,根本记不住。但是我不能让我的学生发现这一点,否则会很没面子。所以每次要叫学生的名字时原创 2014-07-06 20:09:17 · 553 阅读 · 0 评论 -
ACdream ACfun
题目不难,但由于个人英语不好。。。。。百度了下,题目意思是要求出字典序最小的并且不是所输入字符的子串;也就是输出最多的连续的A;如果没有A,输出一个A;#include#includeint main(){ int a,i,j,b,c,d; char t[105]; scanf("%d",&a); while(a--) { d=1; scanf("%s",t原创 2014-07-12 09:06:47 · 1257 阅读 · 0 评论 -
hdu 1285 确定比赛名次 拓扑排序
第一道拓扑排序题。。拓扑排序就是一个有向图,如果这个图有环就不能用拓扑排序。对于拓扑排序就是将没有进只有出的点或别的先出。。出来后将原来图中与输出有关的线全部删除,直到找不到这要的点或数据。。#include#include#include#includeusing namespace std;int s[505][505];int a,b;int w[10原创 2014-08-05 17:17:13 · 580 阅读 · 0 评论 -
poj 2406 Power Strings KMP匹配
对于数组s[0~n-1],计算next[0~n](多计算一位)。考虑next[n],假设t=n-next[n],如果n%t==0,则t就是问题的解,否则解为1。这样考虑:比如字符串"abababab", a b a b a b a b *next -1 0 1 2 3 4 5 6 7考虑这样的模式匹配,将"ababa原创 2014-08-04 19:54:51 · 585 阅读 · 0 评论 -
hdu 1305 Immediate Decodability
用G++过了,c++无限WA就是一水,就是求输入的字符串中是否有一个是其他字符串的子串;注意这种数据。。。0000010019字符串的长度从大到小;#include#include#includeusing namespace std;char qq[20005];struct node{ int q[2]; int w; node原创 2014-07-21 11:06:14 · 746 阅读 · 2 评论 -
hdu 2594 Simpsons’ Hidden Talents
题意是求第一个字符的前缀和后一个字符串的后缀最大的公共序列,并输出。。。将两个字符串合并,求出kmp中的next数组就行,但要注意不要大于某个字符串的长度;#include #include const int N = 50005;#define min(a,b) ((a)char s1[N], s2[N], s3[N * 2];int next[N * 2];原创 2014-08-04 17:31:26 · 640 阅读 · 0 评论