摘要: 凭着感觉写的,维数有点多,脑子就有点乱。。状态转移,还是挺好想的,开个标记数组记录j-1的最大唱片数。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: rockers 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <iostream> 9 #include <cmath>10 using namespace std;11 int dp[21][21],o[21];12 int p[21];13 int main()14 {15 int i,j,k,n, 阅读全文
posted @ 2013-02-16 20:43 Naix_x 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 模板题。精度让我错了一次。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: fence9 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <iostream> 9 #include <cmath>10 using namespace std;11 int gcd(int a,int b)12 {13 return b == 0?a:gcd(b,a%b);14 }15 int main()16 {17 int x,y,p;18 int a,s,... 阅读全文
posted @ 2013-02-16 20:35 Naix_x 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 数据结构基础。忘了,还得看以前写的。。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: heritage 5 */ 6 #include<stdio.h> 7 #include<string.h> 8 void build(int n,char *s1,char *s2,char *s) 9 {10 int i;11 if(n <= 0) return ;12 for(i = 0; i < n; i ++)13 {14 if(s1[0] == s2[i])15 ... 阅读全文
posted @ 2013-02-16 20:33 Naix_x 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 这个题卡了3个月啊,看了题解依旧不会写。。。从中找了一个思路比较简单,而且好写的,把每个顶点,左右微调一下,然后找出穿过起点到微调后的点 最近的边,一定可以看见。这个算法正确性,我不太确定,确实可以把所有数据过掉。。调了好久,好久,各种变量名敲错啊,后边大部分全是抄的。。。第三章终于做完了。。。那3个很快就水过了。。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: fence4 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <iostream> ... 阅读全文
posted @ 2013-02-16 20:31 Naix_x 阅读(278) 评论(0) 推荐(0) 编辑