题意

        额,就是给你 5 张牌,让你判定这手牌的分数,纯模拟,具体的规则如下:
   1、Straight flush: 1000 points five cards of the same suit in sequence, such as 76543 of hearts. Note that AKQJX is treated as a valid sequence. 
   2、Four of a kind: 750 points four cards of the same rank accompanied by a "kicker", like 44442.  
   3、Full house: 500 points three cards of one rank accompanied by two of another, such as 777JJ. 
   4、Flush: 350 points five cards of the same suit, such as AJ942 of hearts. 
   5、Straight: 250 points five cards in sequence, such as 76543. Note that AKQJX is treated as a valid sequence. 
   6、Three of a kind: 200 points three cards of the same rank and two kickers of different ranks, such as KKK84. 
   7、Two pairs: 100 points two cards of one rank, two cards of another rank and a kicker of a third rank, such as KK449. 
   8、One pair: 50 points two cards of one rank accompanied by three kickers of different ranks, such as AAK53. 
   9、None of the above: O point any hand that does not qualify as one of the better hands above, such as KJ542 of mixed suits.
不知道当时拼着怎样的毅力做完的。。。反正分数是一次增大的,从上到下判断就行,好恶心

AC通道

POJ 2694. A Simple Poker Game

代码

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <stack>#define INT_INF 0x3fffffff
#define LL_INF 0x3fffffffffffffff
#define EPS 1e-12
#define MOD 1000000007
#define PI 3.141592653579798
#define N 300using namespace std;typedef long long LL;
typedef unsigned long long ULL;
typedef double DB;struct data
{char s[2];
} card[6];bool cmp(data a,data b)
{if(a.s[1]==b.s[1]) return a.s[0]<b.s[0];else return a.s[1]<b.s[1];
}int cal()
{int fg1=1 , fg2=1;for(int i=1;i<=4;i++)if(card[i].s[0]!=card[i+1].s[0]){fg1=0;break;}for(int i=1;i<=4;i++)if(card[i].s[1]!=card[i+1].s[1]-1){fg2=0;break;}if(card[1].s[1]==1 && card[2].s[1]==10 && card[3].s[1]==11 && card[4].s[1]==12 && card[5].s[1]==13) fg2=1;if(fg1 && fg2) return 1000;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]==card[5].s[1]) return 750;if(card[1].s[1]==card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 750;if(card[1].s[1]==card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]==card[5].s[1]) return 500;if(card[1].s[1]==card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]==card[5].s[1]) return 500;if(fg1) return 350;if(fg2) return 250;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]==card[5].s[1]) return 200;if(card[1].s[1]==card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 200;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]==card[5].s[1]) return 100;if(card[1].s[1]==card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]==card[5].s[1]) return 100;if(card[1].s[1]==card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 100;if(card[1].s[1]==card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 50;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]==card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 50;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]==card[4].s[1] && card[4].s[1]!=card[5].s[1]) return 50;if(card[1].s[1]!=card[2].s[1] && card[2].s[1]!=card[3].s[1] && card[3].s[1]!=card[4].s[1] && card[4].s[1]==card[5].s[1]) return 50;return 0;
}int main()
{int n;scanf("%d",&n);for(int ca=1;ca<=n;ca++){for(int i=1;i<=5;i++){scanf("%s",&card[i].s);if(card[i].s[1]>='0' && card[i].s[1]<='9') card[i].s[1]=card[i].s[1]-'0';if(card[i].s[1]=='A') card[i].s[1]=1;if(card[i].s[1]=='X') card[i].s[1]=10;if(card[i].s[1]=='J') card[i].s[1]=11;if(card[i].s[1]=='Q') card[i].s[1]=12;if(card[i].s[1]=='K') card[i].s[1]=13;}sort(card+1,card+1+5,cmp);printf("%d\n",cal());}return 0;
}

POJ 2694. A Simple Poker Game相关推荐

  1. 【线段树】【模板】讲解 + 例题1 HDU - 1754 I Hate It (点修改分数)+ 例题二 POJ - 3468 A Simple Problem with Integers(区间加值)

    [线段树][模板]讲解 + 例题1 HDU - 1754 I Hate It (点修改分数)+ 例题二 POJ - 3468 A Simple Problem with Integers(区间加值) ...

  2. poj 3243:A Simple Problem with Integers

    3243:A Simple Problem with Integers 查看 提交 统计 提示 提问 总时间限制:  5000ms  单个测试点时间限制:  2000ms  内存限制:  131072 ...

  3. POJ 3468 A Simple Problem with Integers

    分析:这题wa了好多次(看了下discuss好多人也是这样,好题~).一处是sum值会超int32,要用int64.还有一处是toadd要累加,我不知道是受上一题影响还是怎的..pushdown的时候 ...

  4. POJ 3922 A simple stone game(K倍减法游戏)

    题目链接:http://poj.org/problem?id=3922 题意:两人取一堆石子,石子有n个. 先手第一次不能全部取完但是至少取一个.之后每人取的个数不能超过另一个人上一次取的数的K倍.拿 ...

  5. poj 3468 A Simple Problem with Integers(线段树区区)

    题目链接:  http://poj.org/problem?id=3468 题目大意:  给出N个数,和M次查询 C a b c  区间[a,b]的值都加上c Q a b     查询区间[a,b]值 ...

  6. POJ 3468 A Simple Problem with Integers(线段树:区间更新)

    http://poj.org/problem?id=3468 题意: 给出一串数,每次在一个区间内增加c,查询[a,b]时输出a.b之间的总和. 思路: 总结一下懒惰标记的用法吧. 比如要对一个区间范 ...

  7. POJ Area of Simple Polygons 扫描线

    这个题lba等神犇说可以不用离散化,但是我就是要用. 题干: DescriptionThere are N, 1 <= N <= 1,000 rectangles in the 2-D x ...

  8. POJ 3468 A Simple Problem with Integers (1)

    POJ_3468(1) 在消化了PPT上思想之后,又重新做了一下这个题目. 不妨将原数组的元素记作a[i],然后我们用堆建立两棵线段树,一棵的原数组为x[i](x[i]=a[i]-a[i-1],即原数 ...

  9. POJ - 3468 A Simple Problem with Integers(分块)

    题目链接:点击查看 题目大意:给出一个长度为 n 的数列,再给出 m 次操作,每次操作分为两种情况: C l r d:区间 [ l , r ] 内的数字都加上 d Q l r :查询 [ l , r ...

最新文章

  1. brew更新的时候不更新某个应用_这样用 Git 想不升职加薪都难!
  2. orakill和alter system kill session的区别
  3. java写spark碰到输出为[Ljava.lang.String;@889a8a8的情况
  4. SAP Spartacus如何禁止某些标准的css样式
  5. P3246 [HNOI2016]序列 莫队 + ST表 + 单调栈
  6. C++笔记-使用std::funcional代替函数指针
  7. MySQL innodb load data.vs.insert 前因后果
  8. spring的事务回滚机制,事务原理
  9. WINDOWS SERVER 2008 R2 GHO 纯净版
  10. perl的几个小tips
  11. 博文视点大讲堂第18期:从草根到巨人——互联网时代的LAMP开源架构
  12. Js判断当前浏览者的操作系统
  13. CS224N笔记——高级词向量表示
  14. ASP.NET MVC Framework体验(1):从一个简单实例开始(转)
  15. 成功销售的六个关键步骤
  16. Linux使用QQ邮箱
  17. Win10 系统C盘 容量变大,如何清理,亲测有效
  18. 第19篇:WEB漏洞~SQL注入~SqlMap绕过WAF
  19. ROS-control-gazebo-moveit-grasp(一、场景搭建)
  20. 雷电三接口有什么用_支持正反插拔的雷电接口,还有什么让人无法拒绝的特性呢...

热门文章

  1. 真正解决iframe高度自适应问题
  2. 国家标准:电子计算机机房设计规范
  3. 顶尖数据恢复软件官方正式版
  4. linux系统ISO下载网址大全
  5. 人工智能免遥控 暴风65英寸人工智能电视X5 ECHO评测
  6. 无间还是有道 SaaS“年度贡献奖”引猜想
  7. XP系统上出现的“你可能是盗版软件受害者”的解决方法
  8. 使用Visual Studio+OpenCV进行的Susan算子边缘检测及数米粒图像处理实验
  9. python flask 在线可视化平台系统
  10. 机器人课程一切都在快速变化但又好像什么都没变^_^