G - Go Deeper Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Description Here is a procedure's pseudocode:   go(int dep, int n, int m) begin output the value of dep. if dep < m and x[a[dep]] + x[b[dep]] != c[dep] then go(dep…
F - Error Curves Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Description Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which h…
hdu 4111  Alice and Bob 博弈:http://www.cnblogs.com/XDJjy/p/3350014.html hdu 4112 Break the Chocolate 数学题: http://www.cnblogs.com/XDJjy/p/3353386.html 努力半月10/1 ~10/17 结合2011上海交通大学命题的成都现场赛练习: 并: 基础数论题 简易的概率题 简单的几何题 简单的数据结构 易懂的建模搜索题 不是特复杂的模拟题 低中档的博弈 最后得整…
Isabella's Message Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1377    Accepted Submission(s): 406 Problem Description Isabella and Steve are very good friends, and they often write letters…
100MB=10^5KB=10^8B 100MB=100*2^10KB=100*2^20B Sample Input2100[MB]1[B] Sample OutputCase #1: 4.63%Case #2: 0.00% # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include <string> # include &…
简单概率题,可以直接由剩余n个递推到剩余0个.现在考虑剩余x个概率为(1-p)的candy时,概率为C(2 * n - x, x) * pow(p, n + 1)  *pow(1 - p, n - x): 在写出x - 1的情况,就可以发现组合数可以直接递推,所以可以直接求.但是考虑到p可能很小,n可能很大,这样的话直接用pow函数会丢失精度,我们可以把double类型写成log10的形式,这样可以保存精度. #include<algorithm> #include<iostream&g…
/** 对于大数的很好的应用,,缩小放大,,保持精度 **/ #include <iostream> #include <cmath> #include <algorithm> #include <cstdio> using namespace std; int main() { double n,p; ; while(cin>>n>>p){ double p1 = log(p+0.0); -p+0.0); )*p1; )*p2; ,…
递推,考虑到一n可以由i * j + 1组合出来,即第二层有j个含有i个元素的子树...然后就可以了.. #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<fstream> #include<sstream> #include<bitset> #include<vector> #include&…
杭州现场赛的题.BFS+DFS #include <iostream> #include<cstdio> #include<cstring> #define inf 9999999 using namespace std; char mp[105][105]; int sq[5][5]; int step[4][2]={{0,1},{1,0},{0,-1},{-1,0}}; struct pos { int x,y; }; int n,m,prn,x,y,tmp,ans…
第一年参加现场赛,比赛的时候就A了这一道,基本全场都A的签到题竟然A不出来,结果题目重现的时候1A,好受打击 ORZ..... 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4800 题目大意:给定C(3,N)支队伍之间对战的获胜概率,再给定一个序列存放队伍编号,每次获胜之后可以选择和当前战胜的对手换队伍.问按给定序列依次挑战全部胜利的最大概率. 解题思路:状压DP dp[i][j]表示使用队伍i从编号j开始挑战全胜的概率,ai[i]表示i位置的队…