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 ...
随机推荐
- Linux环境下一些有用但不常见的命令
Linux环境下一些有用但不常见的命令 1.获取显卡硬件信息 lspci -vnn | grep VGA -A 12 (若是n卡,则用glxinfo) 2.执行*.sh文件 常见的执行*.sh文件当属 ...
- 51nod 1070 Bash游戏 V4
这种博弈题 都是打表找规律 可我连怎么打表都不会 这个是凑任务的吧....以后等脑子好些了 再琢磨吧 就是斐波那契数列中的数 是必败态 #include<bits/stdc++.h> u ...
- python 写文件刷新缓存
搞爬虫的时候,结果是通过file.write(strs)写入文件的. 带来的问题是,进程如果是被杀死的时候,最后一条结果总是缺损的,因为缓存的部分还未写入文件. 解决办法是每次写入文件时,都刷新缓存, ...
- HDU 6125 Free from square(状态压缩+分组背包)
http://acm.hdu.edu.cn/showproblem.php?pid=6125 题意: 在${1,2,3,...n}$的数中选择1~k个数,使得它们的乘积不能被平方数整除(1除外),计算 ...
- Unity3d 生命周期
生命周期的开始 1.awake → 脚本被载入时调用的 ↓ 2.OnEnable → 当对象变为可用或激活状态时 ↓ 3.Start → 第一次Update之前调用 ↓ 4.FixedUpdat ...
- Linux——进程管理学习简单笔记
基本概念: 进程和程序的区别 : 1.程序是静态概念,本身作为一种软件资源长期保存:而进程是程序的执行过程,它是动态概念,有一定的生命期,是动态产生和消亡的. 2.程序和进程无一一对应关系.一个程序可 ...
- Linux——文件处理命令简单学习总结
linux中一共有三种用户: 1: 所有者u(User) 2: 所属组g(group) 3: 其他用户o(other) linux中权限一共分三种: 1: r read 读权限 2: w write ...
- 《剑指offer》第三十八题(字符串的排列)
// 面试题38:字符串的排列 // 题目:输入一个字符串,打印出该字符串中字符的所有排列.例如输入字符串abc, // 则打印出由字符a.b.c所能排列出来的所有字符串abc.acb.bac.bca ...
- Java 集合-Arrays工具类的介绍
2017-10-31 18:39:46 Arrrays工具类:此类包含用来操作数组(比如排序和搜索)的各种方法. 常用方法: 主要是数组的一些常用方法如: asList:将数组转成集合 binaryS ...
- HTML提交方式post和get区别(实验)
HTML提交方式post和get区别(实验) 一.post和get区别 get提交,提交的信息都显示在地址栏中. post提交,提交的信息不显示地址栏中,显示在消息体中. 二.客户端代码 <!D ...