Amusing Joke

简介: Amusing Joke

文章目录

一、Amusing Joke

总结


一、Amusing Joke

本题链接:Amusing Joke


题目:

A. Amusing Joke

time limit per test2 seconds

memory limit per test256 megabytes

inputstandard input

outputstandard output

So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two “New Year and Christmas Men” meet, thear assistants cut out of cardboard the letters from the guest’s name and the host’s name in honor of this event. Then the hung the letters above the main entrance. One night, when everyone went to bed, someone took all the letters of our characters’ names. Then he may have shuffled the letters and put them in one pile in front of the door.


The next morning it was impossible to find the culprit who had made the disorder. But everybody wondered whether it is possible to restore the names of the host and his guests from the letters lying at the door? That is, we need to verify that there are no extra letters, and that nobody will need to cut more letters.


Help the “New Year and Christmas Men” and their friends to cope with this problem. You are given both inscriptions that hung over the front door the previous night, and a pile of letters that were found at the front door next morning.


Input

The input file consists of three lines: the first line contains the guest’s name, the second line contains the name of the residence host and the third line contains letters in a pile that were found at the door in the morning. All lines are not empty and contain only uppercase Latin letters. The length of each line does not exceed 100.


Output

Print “YES” without the quotes, if the letters in the pile could be permuted to make the names of the “New Year and Christmas Men”. Otherwise, print “NO” without the quotes.


Examples

input

SANTACLAUS

DEDMOROZ

SANTAMOROZDEDCLAUS

output

YES


input

PAPAINOEL

JOULUPUKKI

JOULNAPAOILELUPUKKI

output

NO


input

BABBONATALE

FATHERCHRISTMAS

BABCHRISTMASBONATALLEFATHER

output

NO


Note

In the first sample the letters written in the last line can be used to write the names and there won’t be any extra letters left.


In the second sample letter “P” is missing from the pile and there’s an extra letter “L”.


In the third sample there’s an extra letter “L”.


本博客给出本题截图:

image.png

image.png

题意:两个字符串中的元素经过自由组合后是否能变成第三个字符串,可以的话输出YES,不可以的话输出NO

AC代码

#include <iostream>
#include <string>
using namespace std;
const int N = 30;
int p[N], q[N];
int main()
{
    string a, b, c;
    cin >> a >> b >> c;
    for (int i = 0; i < a.size(); i ++ )
        p[a[i] - 'A'] ++;
    for (int i = 0; i < b.size(); i ++ )
        p[b[i] - 'A'] ++;
    for (int i = 0; i < c.size(); i ++ )
        q[c[i] - 'A'] ++;
    for (int i = 0; i < 27; i ++ )
        if (p[i] != q[i])
        {
            puts("NO");
            exit(0);
        }
    puts("YES");
    return 0;
}

总结

水题,不解释


目录
相关文章
|
1天前
|
存储 关系型数据库 MySQL
数据管理的艺术:PolarDB开源版详评与实战部署策略(一)
PolarDB-X是阿里巴巴自研的高性能云原生分布式数据库,基于共享存储的Shared-nothing架构,支持MySQL生态,具备金融级高可用、分布式水平扩展、HTAP混合负载等能力。它通过CN(计算节点)和DN(存储节点)实现计算与存储分离,保证数据强一致性,并支持全局二级索引和多主多写。PolarDB-X开源版提供更高程度的定制化和控制权,适合追求技术自主性和成本优化的开发者。部署方式包括RPM包、PXD工具和Kubernetes,其中PXD工具提供了一键部署的便利性。
46714 11
|
7天前
|
存储 NoSQL 数据库
为什么要用 Tair 来服务低延时场景 - 从购物车升级说起
“购物车升级”是今年双十一期间提升用户体验的关键项目,展示了大淘宝技术团队致力于通过技术突破消费者和商家体验的天花板。低延迟是这些挑战中的核心,内存数据库Tair因其高吞吐、大连接数、热点请求处理、异常流量管理和复杂计算逻辑优化等特点,在低延迟场景下表现出色。Tair使用内存/SCM混合存储和各种索引来提供低延迟服务,并通过无锁并发、水平扩展分区等技术应对高并发。此外,Tair还通过热点策略、流控和执行流程优化等手段确保在大促时的稳定性和性能。Tair在双十一期间支持了购物车、销量统计、卖家优惠券召回和互动场景等多种业务,展现其低延迟和高并发的能力。
76563 10
|
7天前
|
SQL 设计模式 Java
【软件工程底层逻辑系列】建模的底层逻辑
在本文中,给出建模的底层逻辑:用图形逻辑地表达现实业务的抽象,通过一些大家通识的技术案例讲述建模的过程。
74856 1
|
7天前
|
人工智能 安全 Devops
让研发规范管得住 - 我们为什么在流水线之上又做了研发流程?
研发规范的目标,是为了解决或降低出现软件危机的风险。但传统流水线受限于工具的定位,无法解决研发规范的落地问题,需要在更高的层面来解决。阿里云云效团队经过内部启发后推出的新产品:云效应用交付平台 AppStack 给出了解决方案,快来使用体验吧!
78340 3
|
5天前
|
关系型数据库 Serverless 分布式数据库
高峰无忧,探索PolarDB PG版Serverless的弹性魅力
在数字经济时代,数据库成为企业命脉,面对爆炸式增长的数据,企业面临管理挑战。云原生和Serverless技术革新数据库领域,PolarDB PG Serverless作为阿里云的云原生数据库解决方案,融合Serverless与PostgreSQL,实现自动弹性扩展,按需计费,降低运维成本。它通过计算与存储分离技术,提供高可用性、灾备策略和简化运维。PolarDB PG Serverless智能应变业务峰值,实时监控与调整资源,确保性能稳定。通过免费体验,用户可观察其弹性性能和价格力,感受技术优势。
|
15天前
|
SQL 消息中间件 Swift
【一文看懂】Havenask单机模式创建
本次分享内容为Havenask单机模式,由下面3个部分组成(Hape工具介绍、创建单机版Havenask、Hape问题排查),希望可以帮助大家更好了解和使用Havenask。
127062 0
|
14天前
|
存储 运维 监控
|
14天前
|
存储 SQL Apache
阿里云数据库内核 Apache Doris 基于 Workload Group 的负载隔离能力解读
阿里云数据库内核 Apache Doris 基于 Workload Group 的负载隔离能力解读
阿里云数据库内核 Apache Doris 基于 Workload Group 的负载隔离能力解读
|
20天前
|
人工智能 弹性计算 算法
一文解读:阿里云AI基础设施的演进与挑战
对于如何更好地释放云上性能助力AIGC应用创新?“阿里云弹性计算为云上客户提供了ECS GPU DeepGPU增强工具包,帮助用户在云上高效地构建AI训练和AI推理基础设施,从而提高算力利用效率。”李鹏介绍到。目前,阿里云ECS DeepGPU已经帮助众多客户实现性能的大幅提升。其中,LLM微调训练场景下性能最高可提升80%,Stable Difussion推理场景下性能最高可提升60%。
124117 83
|
15天前
|
存储 弹性计算 Cloud Native
1 名工程师轻松管理 20 个工作流,创业企业用 Serverless 让数据处理流程提效
为应对挑战,语势科技采用云工作流CloudFlow和函数计算FC,实现数据处理流程的高效管理与弹性伸缩,提升整体研发效能。
64756 2