摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4649枚举当前状态是0或者是1的概率 其实就枚举1的概率 最后概率乘这个数位运算用得不熟 老出错 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int a[210]; 8 char c[210]; 9 double p[210],dp[210];10 int main()11 {12 int i,j,n,kk=0;13 while(scanf("%d",&n)!=EOF 阅读全文
posted @ 2013-08-17 21:35
_雨
阅读(194)
评论(0)
推荐(0)
摘要:
涨了那么一点 。。A纯水 把CF都交挂了。。B 扩展与x相同 或与y相同 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int gcd(int a,int b) 8 { 9 return b==0? a:gcd(b,a%b);10 }11 int main()12 {13 int i,j,a,b,c,d;14 cin>>a>>b>>c>>d;15 int x =a*c/gcd(a,c);16 int y = b*d/gcd(b,d); 阅读全文
posted @ 2013-08-17 19:48
_雨
阅读(232)
评论(0)
推荐(0)
摘要:
http://poj.org/problem?id=2411下次还是去学习下dfs的写法吧 自己乱写的好像有点乱 乱七八糟改了一通过了以1 1 表示横着的 1 0 表示竖着的 枚举每一行的状态 再枚举前一行的状态判断是否可以同存注意最后一行要特殊判断一下 0夹着着的1必须为偶数 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define N 3010 8 #define LL __int64 9 LL dp[15][N],o[2][N],k[15];10 int main()1. 阅读全文
posted @ 2013-08-17 19:42
_雨
阅读(327)
评论(0)
推荐(0)

浙公网安备 33010602011771号