codeforces 312
2013-05-27 19:17
197 查看
A. Whose sentence is it?
代码://codeforces 312 A //2013-05-01-19.12 #include <stdio.h> #include <string.h> char str[102]; int main() { int n; scanf("%d", &n); getchar(); while (n--) { int f = 0; int r = 0; gets(str); int l = strlen(str); if (str[0] == 'm' && str[1] == 'i' && str[2] == 'a' && str[3] == 'o' && str[4] == '.') r = 1; if (str[l-5] == 'l' && str[l-4] == 'a' && str[l-3] == 'l' && str[l-2] == 'a' && str[l-1] == '.') f = 1; if ((!f&&!r) || (f && r)) puts("OMG>.< I don't know!"); else if (f && !r) puts("Freda's"); else puts("Rainbow's"); } return 0; }
B. Archer
//codeforces 312 B //2013-05-01-19.51 #include <stdio.h> const double inf = 0.00000000001; int main() { double a, b, c, d; double sw, zw, sl, zl; // snallr win zanoes win and lost while (scanf("%lf %lf %lf %lf", &a, &b, &c, &d) != EOF) { sw = a/b; sl = 1.0 - sw; zw = c/d; zl = 1.0 - zw; double ans = 0; double tmp = 1.0; while(1) { ans += tmp*sw; tmp = tmp*sl*zl; if (tmp < inf) break; } printf("%.12lf\n", ans); } return 0; }
相关文章推荐
- codeforces 312
- Codeforces-Div312
- Codeforces-352A
- Codeforces 559A Gerald's Hexagon 数三角形
- codeforces 623D
- codeforces 718 C.Sasha and Array
- codeforces 699C Vacations
- 【Codeforces700D】Huffman Coding on Segment
- CF->CodeForces 256A
- 【CODEFORCES】 E. Pillars
- Codeforces 217A: Ice Skating
- Codeforces-712B-Memory and Trident
- Codeforces #409div2 C
- CodeForces - 330D Biridian Forest —— BFS 逆搜
- Codeforces-356C
- CodeForces 454C——数学——Little Pony and Expected Maximum
- Codeforces 394D Physical Education and Buns 胡搞
- CodeForces 645C Enduring Exodus
- Codeforces 560E Gerald and Giant Chess 组合数学+DP
- codeforces 330A Cakeminator