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天前
|
存储 机器学习/深度学习 人工智能
打破硬件壁垒!煎饺App:强悍AI语音工具,为何是豆包AI手机平替?
直接上干货!3000 字以上长文,细节拉满,把核心功能、使用技巧和实测结论全给大家摆明白,读完你就知道这款 “安卓机通用 AI 语音工具"——煎饺App它为何能打破硬件壁垒?它接下来,咱们就深度拆解煎饺 App—— 先给大家扒清楚它的使用逻辑,附上“操作演示”和“🚀快速上手不踩坑 : 4 条核心操作干货(必看)”,跟着走零基础也能快速上手;后续再用真实实测数据,正面硬刚煎饺 App的语音助手口令效果——创建京东「牛奶自动下单神器」口令 ,从修改口令、识别准确率到场景实用性,逐一测试不掺水,最后,再和豆包 AI 手机语音助手的普通版——豆包App对比测试下,简单地谈谈煎饺App的能力边界在哪?
|
3天前
|
云安全 监控 安全
|
8天前
|
机器学习/深度学习 人工智能 自然语言处理
Z-Image:冲击体验上限的下一代图像生成模型
通义实验室推出全新文生图模型Z-Image,以6B参数实现“快、稳、轻、准”突破。Turbo版本仅需8步亚秒级生成,支持16GB显存设备,中英双语理解与文字渲染尤为出色,真实感和美学表现媲美国际顶尖模型,被誉为“最值得关注的开源生图模型之一”。
1065 5
|
10天前
|
机器学习/深度学习 人工智能 数据可视化
1秒生图!6B参数如何“以小博大”生成超真实图像?
Z-Image是6B参数开源图像生成模型,仅需16GB显存即可生成媲美百亿级模型的超真实图像,支持中英双语文本渲染与智能编辑,登顶Hugging Face趋势榜,首日下载破50万。
713 42
|
14天前
|
人工智能 Java API
Java 正式进入 Agentic AI 时代:Spring AI Alibaba 1.1 发布背后的技术演进
Spring AI Alibaba 1.1 正式发布,提供极简方式构建企业级AI智能体。基于ReactAgent核心,支持多智能体协作、上下文工程与生产级管控,助力开发者快速打造可靠、可扩展的智能应用。
1144 41
|
14天前
|
人工智能 前端开发 算法
大厂CIO独家分享:AI如何重塑开发者未来十年
在 AI 时代,若你还在紧盯代码量、执着于全栈工程师的招聘,或者仅凭技术贡献率来评判价值,执着于业务提效的比例而忽略产研价值,你很可能已经被所谓的“常识”困住了脚步。
884 72
大厂CIO独家分享:AI如何重塑开发者未来十年
|
10天前
|
存储 自然语言处理 测试技术
一行代码,让 Elasticsearch 集群瞬间雪崩——5000W 数据压测下的性能避坑全攻略
本文深入剖析 Elasticsearch 中模糊查询的三大陷阱及性能优化方案。通过5000 万级数据量下做了高压测试,用真实数据复刻事故现场,助力开发者规避“查询雪崩”,为您的业务保驾护航。
535 31
|
17天前
|
数据采集 人工智能 自然语言处理
Meta SAM3开源:让图像分割,听懂你的话
Meta发布并开源SAM 3,首个支持文本或视觉提示的统一图像视频分割模型,可精准分割“红色条纹伞”等开放词汇概念,覆盖400万独特概念,性能达人类水平75%–80%,推动视觉分割新突破。
978 59
Meta SAM3开源:让图像分割,听懂你的话
|
2天前
|
机器学习/深度学习 传感器 自动驾驶
具身智能核心突破:物理模拟器与世界模型协同技术拆解
本文系统综述了物理模拟器与世界模型在具身智能发展中的协同作用,提出五级智能机器人分类体系(IR-L0至IR-L4),分析其在运动、操作与交互中的进展,并对比主流仿真平台与世界模型架构,探讨其在自动驾驶与关节机器人中的应用及未来挑战。
169 113

热门文章

最新文章