[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");
}
随机推荐
- 使用 OpenTelemetry 构建 .NET 应用可观测性(1):什么是可观测性
目录 什么是系统的可观测性(Observability) 为什么需要软件系统需要可观测性 可观测性的三大支柱 日志(Logging) 指标(Metrics) 分布式追踪(Distributed Tra ...
- C++算法之旅、04 基础篇 | 第一章
常用代码模板1--基础算法 - AcWing ios::sync_with_stdio(false) 提高 cin 读取速度,副作用是不能使用 scanf 数据输入规模大于一百万建议用scanf 快速 ...
- 要调用API接口获取商品数据,首先需要了解该API的文档和规范
要调用API接口获取商品数据,首先需要了解该API的文档和规范.大多数API都需要使用API密钥进行身份验证,因此您需要先注册API提供商,并从他们那里获取API密钥.以下是一些通用的步骤: 1. ...
- 10款Visual Studio实用插件
前言 俗话说的好工欲善其事必先利其器,安装一些Visual Studio实用插件对自己日常的开发和工作效率能够大大的提升,避免996从选一款好的IDE实用插件开始.以下是我认为比较实用的Visual ...
- 试试用Markdown来设计表单
相信很多后端开发.对于前端知识是比较零碎的,所以很多时候写表单这样的工作,一般就是复制黏贴,然后改改字段.对于HTML格式,一直觉得比较杂乱,不够简洁. 最近TJ发现了一个有趣的小工具:Create ...
- 关于Unity 如何与Blazor Server结合
关于Unity 如何与Blazor Server结合 一.介绍 最近工作中有`Unity`与`Blazor Server`结合的需求,在网上找了一圈,发现这方面的资料比较少,特此写下这篇记录一下自己的 ...
- MySQL实战实战系列 04 深入浅出索引(下)
在上一篇文章中,我和你介绍了 InnoDB 索引的数据结构模型,今天我们再继续聊聊跟 MySQL 索引有关的概念. 在开始这篇文章之前,我们先来看一下这个问题: 在下面这个表 T 中,如果我执行 se ...
- pandas -- DataFrame的级联以及合并操作
博客地址:https://www.cnblogs.com/zylyehuo/ 开发环境 anaconda 集成环境:集成好了数据分析和机器学习中所需要的全部环境 安装目录不可以有中文和特殊符号 jup ...
- 前端三件套系例之HTML——HTML文档结构、文档声明、主体结构标签、HEAD头部标签、meta元信息、Body内常用标签、6 其他了解
文章目录 HTML文档结构 1. 文档声明 2.主体结构标签 3.HEAD头部标签 4.meta元信息 5 Body内常用标签 5.1 基本标签(块级标签和内联标签) 5.2 div标签和span标签 ...
- Chapter 57. Multi-project Builds
http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects The po ...