Alphabet Cookies
Alphabet Cookies
题目描述
Kitty likes cookies very much, and especially the alphabet cookies. Now, she get some alphabet cookies, and she wants to select some of them to spell some words.
The easy task for you, is to determine that whether she can spell the word she wants.

输入
The input contains several test cases.
Each test case contains an integer N ( 0 < N ≤ 100 ) in a line.
And followed a line with N capital letters, means the cookies she has.
Then the last line is a word with capital letters. And the word’s length isn’t more than N.
输出
One word for each test case. If she can spell the word by these letters, please output “Yes”, nor output “No”.
样例输入
7ARDHPYPHAPPY6ARDHPYHAPPY
样例输出
YesNo
题意:
给出现在拥有的饼干数,问使用这些饼干是否可以拼成下面的字母
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<algorithm>
using namespace std;
int main()
{
    int i,j;
    int aa[100];
    char ch[1000];
    char str[1000];
    int n,m;
    while(~scanf("%d",&n)){
        scanf("%s %s",str,ch);
        m=0;
        int len=strlen(ch);
        for(i=0;i<n;i++){
            for(j=0;j<len;j++){
                if(str[i]==ch[j]){
                    ch[j]='#';
                    m++;
                    break;
                }
            }
        }
        if(m<len){
            printf("No\n");
        }else printf("Yes\n");
    }
    return 0;
}
Alphabet Cookies的更多相关文章
- WUSTOJ 1321: Alphabet Cookies(Java)字符统计
		
题目链接:1321: Alphabet Cookies Description Kitty likes cookies very much, and especially the alphabet c ...
 - scrapy cookies:将cookies保存到文件以及从文件加载cookies
		
我在使用scrapy模拟登录新浪微博时,想将登录成功后的cookies保存到本地,下次加载它实现直接登录,省去中间一系列的请求和POST等.关于如何从本次请求中获取并在下次请求中附带上cookies的 ...
 - ASP.Net MVC Session和Cookies的简单使用
		
目标:用Session和Cookies实现登陆信息保存和展现 Cookies实现: Controller: //把登陆用户名存到cookies中 HttpCookie cook = new HttpC ...
 - Webform(六)——登录状态保持(Cookies内置对象)
		
用户用浏览器访问一个网站,由于采用的http的特性,Web服务器并不能知道是哪一个用户正在访问,但一些网站,希望能够知道访问者的一些信息,例如是不是第一次访问,访问者上次访问时是否有未做完的工作,这次 ...
 - [LeetCode] Assign Cookies 分点心
		
Assume you are an awesome parent and want to give your children some cookies. But, you should give e ...
 - jquery缓存使用jquery.cookies.2.2.0.min.js
		
$.cookies.set(key, obj, { hoursToLive: 2}); key标识的键 , obj存入的值可以缓存json对象, hoursToLive 缓存小时数 $.cookies ...
 - C# HttpWebRequest获取COOKIES
		
C# HttpWebRequest获取COOKIES byte[] bytes = Encoding.Default.GetBytes(_post); CookieContainer myCookie ...
 - HTML5-本地存储与cookies
		
一.H5的几种存储形式 1.本地存储(localstorage和sessionstorage) 存储形式:key-->value 过期策略:localstorage永久存储,不过期,除非手动删除 ...
 - scrapy加载cookies登陆
		
import scrapy from xxxx.items import XXXXItem from scrapy.http.request import Request class ZndsSpid ...
 
随机推荐
- 高斯日记|2013年蓝桥杯B组题解析第一题-fishers
			
高斯日记 大数学家高斯有个好习惯:无论如何都要记日记. 他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210 后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几 ...
 - jsp拾遗
			
JSP九大内置对象,七大动作,三大指令 https://blog.csdn.net/qq_34337272/article/details/64310849 JSP页面的静态包含和动态包含 https ...
 - Spring Cloud微服务体系搭建
			
前期架构设计图: 参考博文: Eureka相关: Eureka注册与发现(高可用注册中心.注册服务.Feign服务调用):https://blog.csdn.net/qq_32529383/artic ...
 - url rewrite导致的500.19  0x8007000d
			
https://stackoverflow.com/questions/13532447/http-error-500-19-iis-7-5-error-0x8007000d It seems you ...
 - 【Coursera】Seventh Week
			
Application Layer:Use the services of the TCP layer Quick Review Link Layer(Ethernet):gets the data ...
 - UVa 11212 编辑书稿(dfs+IDA*)
			
https://vjudge.net/problem/UVA-11212 题意:给出n个自然段组成的文章,将他们排列成1,2...,n.每次只能剪切一段连续的自然段,粘贴时按照顺序粘贴. 思路:状态空 ...
 - telnet不是内部或外部命令的解决方案
			
telnet主要是为了维护使用,windows默认不打开这个功能,所有无法登陆 按照下面截图,可轻松打开telnet功能 点击控制面板 选择程序和功能 点击左上角打开 turn windows fea ...
 - 如何优化myeclipse.
			
1.去除不需要加载的模块 一个系统20%的功能往往能够满足80%的需求,MyEclipse也不例外,我们在大多数时候只需要20%的系统功能,所以可以将一些不使用的 模块禁止 加载启动.通过Window ...
 - [ios]ios tts的使用
			
参考:http://www.tekuba.net/program/327/ http://blog.sina.com.cn/s/blog_923fdd9b0101flx3.html iOS平台由于本身 ...
 - 《A_Pancers团队》———团队项目原型设计与开发
			
一.实验目的与要求 (1)掌握软件原型开发技术: (2)学习使用软件原型开发工具:本实验中使用墨刀 二.实验内容与步骤 任务1:针对实验六团队项目选题,采用适当的原型开发工具设计团队项目原型: 任务2 ...