[ABC263A] Full House
Problem Statement
We have five cards with integers $A$, $B$, $C$, $D$, and $E$ written on them, one on each card.
This set of five cards is called a Full house if and only if the following condition is satisfied:
- the set has three cards with a same number written on them, and two cards with another same number written on them.
Determine whether the set is a Full house.
Constraints
- $1 \leq A,B,C,D,E\leq 13$
- Not all of $A$, $B$, $C$, $D$, and $E$ are the same.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$A$ $B$ $C$ $D$ $E$
Output
If the set is a Full house, print Yes; otherwise, print No.
Sample Input 1
1 2 1 2 1
Sample Output 1
Yes
The set has three cards with $1$ written on them and two cards with $2$ written on them, so it is a Full house.
Sample Input 2
12 12 11 1 2
Sample Output 2
No
The condition is not satisfied.
把5个数排序之后,判断即可。
#include<bits/stdc++.h>
using namespace std;
int a[5];
int main()
{
for(int i=0;i<5;i++)
scanf("%d",a+i);
sort(a,a+5);
if(a[0]==a[1]&&a[1]==a[2]&&a[3]==a[4]&&a[0]!=a[4]||a[0]==a[1]&&a[1]!=a[2]&&a[2]==a[3]&&a[3]==a[4])
printf("Yes");
else
printf("No");
}
随机推荐
- C# QRCode二维码的解析与生成
已知一张二维码图片,怎么生成一张一模一样的图片出来? 最近有个项目,需要用到QRCode,之前只做过Datamatrix格式的,想着应该也是差不多的,于是就依葫芦画瓢,掏出我的陈年OnBarcode类 ...
- CF-1860C Game on Permutation题解
题意:在一条数轴上,Alice可以跳到在你所在点前面且值比当前所在点小的点.每回合可以向任意符合要求的点跳一次.当轮到Alice的回合同时不存在符合要求的点,Alice就赢了.Alice可以选择一个点 ...
- 部署属于自己的New bing Ai
该项目来源 https://github.com/adams549659584/go-proxy-bingai 项目体验地址 https://bing.vcanbb.top/web/#/ 项目介绍 基 ...
- 《数据结构-C语言》单链表
@ 目录 单链表 结构定义 初始化 建立 清空 求表长 判断是否为空表 取值 查找 插入 删除 销毁 遍历打印 测试 单链表 结构定义 #include <stdio.h> #includ ...
- Pisces.IM.Mood 前言
关于 Pisces.IM.Mood Mood Pisces.IM.Mood 一款基于TCP协议的即时通讯开源系统 多个客户端目前支持以下功能: 支持文字,图片,文件,emoji表情的发送 文件限制为5 ...
- 一款Redis可视化工具:ARDM | 京东云技术团队
出众的软件有很多,适合自己的才是最好的. Another Redis Desktop Manager 更快.更好.更稳定的Redis桌面(GUI)管理客户端,兼容Windows.Mac.Linux,性 ...
- visio 2010 kit tools
Getting Office License Configuration Information.---------------------------------------Backing Up L ...
- 多源异构数据信息的融合方式0 - Dempster/Shafer 证据理论(D-S证据理论)
Dempster/Shafer 证据理论(D-S证据理论)的大体内容如下: 一.简介: 在理论中,由互不相容的基本命题组成的完备集合Θ称为识别框架,表示对于某一问题的所有可能答案,但是只有一个答案是正 ...
- 可视化-vscode使用Plotly,绘制直方图
Plotly 是一款用来做数据分析和可视化的在线平台,功能非常强大,可以在线绘制很多图形比如条形图.散点图.饼图.直方图等等. 概述: plotly在python中绘图使用分三种:1.plotly.g ...
- 14.9 Socket 高效文件传输
网络上的文件传输功能也是很有必要实现一下的,网络传输文件的过程通常分为客户端和服务器端两部分.客户端可以选择上传或下载文件,将文件分块并逐块发送到服务器,或者从服务器分块地接收文件.服务器端接收来自客 ...