hdu 4461 The Power of Xiangqi(水题)
来源:互联网 发布:网页js动画特效代码 编辑:程序博客网 时间:2024/05/22 07:59
题目链接:hdu 4461 The Power of Xiangqi
题目大意:两方下象棋,给定两方剩余棋子的种类,根据能力值评估胜者,特殊条件为如果没有马或者炮,战斗力要减
1,如果本来就是1就不用减了。
解题思路:水题,模拟计算。
#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int g[10] = {16, 7, 8, 1, 1, 2, 3};int solve () { char s[3]; int n, ret = 0, v[10]; memset(v, 0, sizeof(v)); scanf("%d", &n); while (n--) { scanf("%s", s); int id = s[0] - 'A'; ret += g[id]; v[id] = 1; } if ((v[1] == 0 || v[2] == 0) && ret != 1) ret--; return ret;}int main () { int cas; scanf("%d", &cas); while (cas--) { int l = solve(); int r = solve(); if (l == r) printf("tie\n"); else printf("%s\n", l > r ? "red" : "black"); } return 0;}
0 0
- hdu 4461 The Power of Xiangqi(水题)
- hdu(4461) The Power of Xiangqi
- HDU 4461 The Power of Xiangqi
- HDU-#4461 The Power of Xiangqi
- HDU-4461-The Power of Xiangqi
- HDU 4461 The Power of Xiangqi
- HDU 4461 The Power of Xiangqi
- hdu 4461 The Power of Xiangqi(水题)
- hdu 4461 The Power of Xiangqi【模拟】水题
- HDU 4461 The Power of Xiangqi(水)
- HDU 4461 The Power of Xiangqi(水)
- hdu 4461 The Power of Xiangqi(简单模拟)
- The Power of Xiangqi(水题)
- hdu4461 The Power of Xiangqi【水题】
- HDU4461:The Power of Xiangqi
- hdu4461 The Power of Xiangqi
- HDU4461 The Power of Xiangqi
- 【杭州赛区现场赛PROBLEM I】阅读理解与模拟-The Power of Xiangqi
- Linux 源码编译与程序运行期间静态库与动态库搜索路径
- cmd的一些简单的命令
- 从1.5k到18k, 一个程序员的5年成长之路
- matlab中图像块(patch)处理命令小结
- Eclipse Java代码格式,用4个空格代替tab键, 这样代码格式跨平台也不会乱。
- hdu 4461 The Power of Xiangqi(水题)
- 鼠标的响应
- powerdesigner 概念模型(conceptualDataModel)创建详解
- Codeforces Round #277.5 (Div. 2)
- Web前端性能优化
- Odoo 表单界面标签与栏位空间调整
- Powerdesigner15-物理模型-导出建表sql语句
- hadoop日志分析
- MVC Json 的返回