摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2381当时比赛的时候看了看这题没什么想法 就去看别的题了 之后cz很快就A了 晚上看了下他的代码 敲了敲遍历一遍 之前标记的会影响后面算数的删掉View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<string.h> 4 using namespace std; 5 char c[1000011]; 6 int f[500]; 7 int 阅读全文
posted @ 2012-08-29 22:08 _雨 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.Ignore punctuation, whitespace, numbers, and case 阅读全文
posted @ 2012-08-29 19:43 _雨 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 这贴来记录自己在做题中曾犯下的各种错误吧1、测试的输出 忘记删掉 这种错误很少出现2、把问题搞复杂 思路不清晰 感觉这样是对的 没去想一想是不是有更好的、更简单一点的 越复杂越容易出错 越不容易把所有的特殊情况考虑到 还是尽量让代码简单一点 思路清晰一点3、没注意输入数据的范围4、最近几次CF中 老挂在精度上 有时候是没想到 有时候是没想到中间值是5、比赛做了几道坑题 一些字符串 如果它说是连续的 最好用scanf或cin 用gets WA惨了 可能会读入没用的空格 还要注意一些数的范围 阅读全文
posted @ 2012-08-29 18:55 _雨 阅读(163) 评论(1) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2383一下午卡死在这道题上了 还错了那么多次 郁闷最后经cz提醒 用求出的循环节对每个字母的循环节取余 算每个位置该输出什么字母View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define LL long long 4 char str[100],ss[10][101]; 5 LL gcd(LL a, LL b) 6 { 7 return b==0?a:gcd( 阅读全文
posted @ 2012-08-29 18:01 _雨 阅读(179) 评论(0) 推荐(0) 编辑
摘要: http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2368我也不知道 这份代码算不算DP 之前写的那份长长的长长的dp死活过不了 可能太长了 bug就太多了。。这个是根据必须保留的来算哪些可以删除 哪些必须保留3种情况当前这个号的日期是‘-’号,‘+’号直接不能删除 继续循环1、 若比前一个不能删除的(pre)大 也就是它们是同一年份的 如果下一个也就是i+1 的年份比i大 也就是它三是一年份的 或者 i+1的年份比pre小或相等 当前i可以删除。2、若比pre小 不同年份 如果i+1的年份比i 阅读全文
posted @ 2012-08-29 11:34 _雨 阅读(146) 评论(0) 推荐(0) 编辑