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");
}

随机推荐

  1. 【pandas小技巧】--统计值作为新列

    这次介绍的小技巧不是统计,而是把统计结果作为新列和原来的数据放在一起.pandas的各种统计功能之前已经介绍了不少,但是每次都是统计结果归统计结果,原始数据归原始数据,没有把它们合并在一个数据集中来观 ...

  2. Flutter系列文章-Flutter在实际业务中的应用

    不同场景下的解决方案 1. 跨平台开发: 在移动应用开发中,面对不同的平台(iOS和Android),我们通常需要编写两套不同的代码.而Flutter通过一套代码可以构建适用于多个平台的应用,大大提高 ...

  3. 《CTFshow-Web入门》04. Web 31~40

    @ 目录 web31 题解 原理 web32 题解 原理 web33 题解 web34 题解 web35 题解 web36 题解 web37 题解 原理 web38 题解 原理 web39 题解 we ...

  4. 深入理解Linux内核——内存管理(2)

    提要:本系列文章主要参考MIT 6.828课程以及两本书籍<深入理解Linux内核> <深入Linux内核架构>对Linux内核内容进行总结. 内存管理的实现覆盖了多个领域: ...

  5. Mybatis plus配置MetaObjectHandler无效

    项目环境 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-b ...

  6. IDEFICS 简介: 最先进视觉语言模型的开源复现

    引言 Code Llama 是为代码类任务而生的一组最先进的.开放的 Llama 2 模型,我们很高兴能将其集成入 Hugging Face 生态系统!Code Llama 使用与 Llama 2 相 ...

  7. 一篇文章让你弄懂分布式一致性协议Paxos

    一.Paxos协议简介 Paxos算法由Leslie Lamport在1990年提出,它是少数在工程实践中被证实的强一致性.高可用.去中心的分布式协议.Paxos协议用于在多个副本之间在有限时间内对某 ...

  8. pandas处理大数据题目的操作

    1.用法:DataFrame.drop(labels=None, axis=0, index=None, columns=None, inplace=False) 2.参数说明: labels:要删除 ...

  9. Django框架项目之支付功能——支付宝支付

    文章目录 支付宝支付 入门 支付流程 aliapy二次封装包 GitHub开源框架 依赖 结构 alipay_public_key.pem app_private_key.pem setting.py ...

  10. Opencv系列之一:简介与基本使用

    1 Opencv简介 Opencv是计算机视觉中经典的专用库,其支持多语言,跨平台,功能强大.Opencv-Python为Opencv提供了Python接口,使得使用者在Python中能够调用C/C+ ...