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 ...
随机推荐
- Wannafly14挑战赛 C(tarjan缩点)题解
题目:牛客题目链接 思路:这道题有点像这道题 先缩点,缩完之后判断一下整个强连通分量入度是不是0,如果是的话向ans压入该强连通分量最小的那个值.最后排序一下ans输出就行了. 思路一下就想到了,就是 ...
- C# 实现简单的 Heap 堆(二叉堆)
如题,C# 实现简单的二叉堆的 Push() 和 Pop(), 如有不足欢迎指正. 另外,在C#中使用 Heap 的相似功能可以考虑使用:Priority Queues,SortedDictiona ...
- UVa 1331 最大面积最小的三角剖分
https://vjudge.net/problem/UVA-1331 题意:输入一个多边形,找一个最大三角形面积最小的三角剖分,输出最大三角形的面积. 思路: 最优三角剖分. dp[i][j]表示从 ...
- MVC ---- ckeditor 批量绑定 blur 事件
在项目遇到个问题,就是把循环出来的ckeditor 批量添加 blur 事件,折腾了2天 终于搞定 @{ ].Rows) { <table class="ui-jqgrid-btabl ...
- codevs 1082 线段树练习 3 区间更新+延迟标记
题目描述 Description 给你N个数,有两种操作: 1:给区间[a,b]的所有数增加X 2:询问区间[a,b]的数的和. 输入描述 Input Description 第一行一个正整数n,接下 ...
- Ubuntu16.04 安装 Django
pip2 install django==1.11 或者手动安装: 链接:https://pan.baidu.com/s/1uQJD-pON7gELoCC2TwYnEw 提取码:flgg cd Dja ...
- NPOI操作
1.操作Excel 准备生成的公共方法(将数据源DataTable转换成MemoryStream) /// <summary> /// 生成Excel /// </summary&g ...
- 对当前JAVA流行框架的一些小感悟
这几年,蹦出了不少各种JAVA框架,像是spring boot.spring cloud 和spring mvc或者是mybatis等等. 不断有人感慨,技术更新的太快,自己学都学不过来了. 但是,这 ...
- Flutter学习笔记(五)
一.Container 是一个便利的Widget,它把通用的绘制.定位和Widget的大小结合了起来. Container会先用padding填充子Widget和border之间的空白,然后添加其他的 ...
- 554C - Kyoya and Colored Balls
554C - Kyoya and Colored Balls 思路:组合数,用乘法逆元求. 代码: #include<bits/stdc++.h> using namespace std; ...