1011. World Cup Betting (20)
2015-11-04 12:36
330 查看
1.较为简单
2.最后的公式为(a*b*c*0.65-1)*2
2.最后的公式为(a*b*c*0.65-1)*2
//#include<string> //#include <iomanip> #include<vector> #include <algorithm> //#include<stack> #include<set> #include<queue> #include<map> //#include<unordered_set> //#include<unordered_map> //#include <sstream> //#include "func.h" //#include <list> #include<stdio.h> #include<iostream> #include<string> #include<memory.h> #include<limits.h> using namespace std; int main(void) { //精度要求,使用double或者float都可以AC vector<vector<double>> game(3, vector<double>(3, 0)); string s[3] = { "W", "T", "L" }; scanf("%lf %lf %lf %lf %lf %lf %lf %lf %lf", &game[0][0], &game[0][1], &game[0][2], &game[1][0], &game[1][1], &game[1][2], &game[2][0], &game[2][1], &game[2][2]); double ans[3]; string out[3]; ans[0] = game[0][0]; ans[1] = game[1][0]; ans[2] = game[2][0]; out[0] = s[0]; out[1] = s[0]; out[2] = s[0]; for (int i = 0; i < 3; i++) { for (int j = 1; j < 3; j++) { if (ans[i] < game[i][j]) { ans[i] = game[i][j]; out[i] = s[j]; } } } double res = (ans[0] * ans[1] * ans[2] * 0.65 - 1) * 2; cout << out[0] << " " << out[1] << " " << out[2] << " "; printf("%.2lf\n", res); return 0; }
相关文章推荐
- [LeetCode] Serialize and Deserialize Binary Tree
- Error:No such property: nexusUsername for class
- Metal Shader Compiler Options
- Mac--键盘输入的技巧
- don't touch your phone in any unfamiliar way(转)
- Codeforces Round #192 (Div. 1) C. Graph Reconstruction 随机化
- jquery滚动到指定元素,模仿锚点
- Android硬件抽象层(HAL)概要介绍和学习计划
- brew-cask 之本地更新 node
- jQuery过滤器
- ubuntu远程桌面连接windows系统
- 1010. Radix (25)
- Mac OS X 10.11安装cocoa pods失败的解决方案
- HTTP_CONNECTION:Keep-Alive
- ADB学习
- Tomcat中session的管理机制
- 1010. Radix (25)
- 线程池
- 网络安全形势复杂,专利积累成第一要务
- java中关于文本文件的读写方法实例总结