Lightoj 1104 概率dp
来源:互联网 发布:淘宝网小棉袄 编辑:程序博客网 时间:2024/06/06 00:50
/**********************jibancanyang************************** *Author* :jibancanyang *Created Time* : 四 5/12 23:37:26 2016 *File Name* : .cpp**Problem**:**Analyse**:**Code**:***********************1599664856@qq.com**********************/#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <cmath>#include <cstdlib>#include <ctime>#include <stack>using namespace std;typedef pair<int, int> pii;typedef long long ll;typedef unsigned long long ull;vector<int> vi;#define pr(x) cout << #x << ": " << x << " " #define pl(x) cout << #x << ": " << x << endl;#define pri(a) printf("%d\n",(a));#define xx first#define yy second#define sa(n) scanf("%d", &(n))#define sal(n) scanf("%lld", &(n))#define sai(n) scanf("%I64d", &(n))#define vep(c) for(decltype((c).begin() ) it = (c).begin(); it != (c).end(); it++) const int mod = int(1e9) + 7, INF = 0x3fffffff;const int maxn = 1e5 + 13;double dp[maxn];int main(void){#ifdef LOCAL //freopen("/Users/zhaoyang/in.txt", "r", stdin); //freopen("/Users/zhaoyang/out.txt", "w", stdout);#endif ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); int T; sa(T); for (int cas = 1; cas <= T; cas++) { dp[0] = 1; int n; sa(n); for (int i = 1; i <= n + 1; i++) { dp[i] = dp[i - 1] * (n + 1.0 - i) / n; //pr(i), pl(dp[i]); if (dp[i] <= 0.5) { printf("Case %d: %d\n", cas, i - 1); break; } } } return 0;}
0 0
- Lightoj 1104 概率dp
- 【LightOJ 1104】Birthday Paradox(概率DP)
- Lightoj 1038 概率DP
- Lightoj 1030 概率DP
- Lightoj 1038 概率DP
- lightoj 概率dp小结
- lightoj 1265 概率dp
- lightoj 1030 概率dp
- Lightoj 1030 概率dp
- Lightoj 1248 概率dp
- lightoj 1038 概率dp
- Lightoj 1265(概率dp)
- lightoj 1151 概率dp + 高斯消元
- LightOJ 1050 - Marbles(概率DP)
- lightoj 1050 - Marbles 概率DP
- LightOJ 1265 (概率DP)
- lightoj - 1064 - Throwing Dice - dp / 概率dp
- 【概率DP】 LightOJ 1027 A Dangerous Maze
- android webview中上传控件点击无效的解决办法
- Android基础——四大组件之Activity
- SPOJ GSS3 Can you answer these queries III
- char * 指向的字符串不能修改
- 表达式求值
- Lightoj 1104 概率dp
- 关于import
- The declared package "com.XXX" does not match the expected package ""
- Web运行流程
- 字符串函数strchr 、 strrchr 、strrstr的实现
- HDU 1176(dp)
- C#调用C++导出函数
- 项目supporting Files资源管理几个选项的含义
- 柴俊理金:5、12午夜黄金、宁贵沥青操作策略