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天前
|
人工智能 自然语言处理 Shell
深度评测 | 仅用3分钟,百炼调用满血版 Deepseek-r1 API,百万Token免费用,简直不要太爽。
仅用3分钟,百炼调用满血版Deepseek-r1 API,享受百万免费Token。阿里云提供零门槛、快速部署的解决方案,支持云控制台和Cloud Shell两种方式,操作简便。Deepseek-r1满血版在推理能力上表现出色,尤其擅长数学、代码和自然语言处理任务,使用过程中无卡顿,体验丝滑。结合Chatbox工具,用户可轻松掌控模型,提升工作效率。阿里云大模型服务平台百炼不仅速度快,还确保数据安全,值得信赖。
85230 22
深度评测 | 仅用3分钟,百炼调用满血版 Deepseek-r1 API,百万Token免费用,简直不要太爽。
|
4天前
|
人工智能 API 网络安全
用DeepSeek,就在阿里云!四种方式助您快速使用 DeepSeek-R1 满血版!更有内部实战指导!
DeepSeek自发布以来,凭借卓越的技术性能和开源策略迅速吸引了全球关注。DeepSeek-R1作为系列中的佼佼者,在多个基准测试中超越现有顶尖模型,展现了强大的推理能力。然而,由于其爆火及受到黑客攻击,官网使用受限,影响用户体验。为解决这一问题,阿里云提供了多种解决方案。
15372 32
|
12天前
|
机器学习/深度学习 人工智能 自然语言处理
PAI Model Gallery 支持云上一键部署 DeepSeek-V3、DeepSeek-R1 系列模型
DeepSeek 系列模型以其卓越性能在全球范围内备受瞩目,多次评测中表现优异,性能接近甚至超越国际顶尖闭源模型(如OpenAI的GPT-4、Claude-3.5-Sonnet等)。企业用户和开发者可使用 PAI 平台一键部署 DeepSeek 系列模型,实现 DeepSeek 系列模型与现有业务的高效融合。
|
12天前
|
人工智能 搜索推荐 Docker
手把手教你使用 Ollama 和 LobeChat 快速本地部署 DeepSeek R1 模型,创建个性化 AI 助手
DeepSeek R1 + LobeChat + Ollama:快速本地部署模型,创建个性化 AI 助手
3210 116
手把手教你使用 Ollama 和 LobeChat 快速本地部署 DeepSeek R1 模型,创建个性化 AI 助手
|
3天前
|
并行计算 PyTorch 算法框架/工具
本地部署DeepSeek模型
要在本地部署DeepSeek模型,需准备Linux(推荐Ubuntu 20.04+)或兼容的Windows/macOS环境,配备NVIDIA GPU(建议RTX 3060+)。安装Python 3.8+、PyTorch/TensorFlow等依赖,并通过官方渠道下载模型文件。配置模型后,编写推理脚本进行测试,可选使用FastAPI服务化部署或Docker容器化。注意资源监控和许可协议。
981 5
|
7天前
|
人工智能 自然语言处理 API
DeepSeek全尺寸模型上线阿里云百炼!
阿里云百炼平台近日上线了DeepSeek-V3、DeepSeek-R1及其蒸馏版本等六款全尺寸AI模型,参数量达671B,提供高达100万免费tokens。这些模型在数学、代码、自然语言推理等任务上表现出色,支持灵活调用和经济高效的解决方案,助力开发者和企业加速创新与数字化转型。示例代码展示了如何通过API使用DeepSeek-R1模型进行推理,用户可轻松获取思考过程和最终答案。
|
11天前
|
API 开发工具 Python
阿里云PAI部署DeepSeek及调用
本文介绍如何在阿里云PAI EAS上部署DeepSeek模型,涵盖7B模型的部署、SDK和API调用。7B模型只需一张A10显卡,部署时间约10分钟。文章详细展示了模型信息查看、在线调试及通过OpenAI SDK和Python Requests进行调用的步骤,并附有测试结果和参考文档链接。
1761 9
阿里云PAI部署DeepSeek及调用
|
9天前
|
人工智能 自然语言处理 JavaScript
宜搭上新,DeepSeek 插件来了!
钉钉宜搭近日上线了DeepSeek插件,无需编写复杂代码,普通用户也能轻松调用强大的AI大模型能力。安装后,平台新增「AI生成」组件,支持创意内容生成、JS代码编译、工作汇报等场景,大幅提升工作效率。快来体验这一高效智能的办公方式吧!
1594 8
|
10天前
|
缓存 自然语言处理 安全
快速调用 Deepseek API!【超详细教程】
Deepseek 强大的功能,在本教程中,将指导您如何获取 DeepSeek API 密钥,并演示如何使用该密钥调用 DeepSeek API 以进行调试。
|
8天前
|
人工智能 数据可视化 Linux
【保姆级教程】3步搞定DeepSeek本地部署
DeepSeek在2025年春节期间突然爆火出圈。在目前DeepSeek的网站中,极不稳定,总是服务器繁忙,这时候本地部署就可以有效规避问题。本文以最浅显易懂的方式带读者一起完成DeepSeek-r1大模型的本地部署。