题目链接:http://codeforces.com/problemset/problem/328/B

水题~

 #include <cstdio>
#include <cstdlib>
#include <cstring>
char n[], a[];
int b[], c[];
int main(void) {
//freopen("in.txt", "r", stdin);
scanf("%s%s", n, a);
int len1 = strlen(n), len2 = strlen(a);
memset(b, , sizeof(b)); memset(c, , sizeof(c));
for (int i = ; i < len1; ++i) b[n[i]-'']++;
for (int i = ; i < len2; ++i) c[a[i]-'']++;
b[]+=b[], b[]=, c[]+=c[], c[]=, b[]+=b[], b[]=, c[]+=c[], c[]=;
int cnt=, Max=;
for (int i = ; i < ; ++i){
if (b[i]){
cnt = c[i]/b[i]; if (cnt < Max) Max = cnt;
}
}
printf("%d\n", Max);
return ;
}

=_=

Codeforces Testing Round #8 B. Sheldon and Ice Pieces 水题的更多相关文章

  1. Codeforces Beta Round #4 (Div. 2 Only) A. Watermelon 水题

    A. Watermelon 题目连接: http://www.codeforces.com/contest/4/problem/A Description One hot summer day Pet ...

  2. Codeforces Beta Round #14 (Div. 2) C. Four Segments 水题

    C. Four Segments 题目连接: http://codeforces.com/contest/14/problem/C Description Several months later A ...

  3. Codeforces Beta Round #14 (Div. 2) B. Young Photographer 水题

    B. Young Photographer 题目连接: http://codeforces.com/contest/14/problem/B Description Among other thing ...

  4. Codeforces Beta Round #6 (Div. 2 Only) A. Triangle 水题

    A. Triangle 题目连接: http://codeforces.com/contest/6/problem/A Description Johnny has a younger sister ...

  5. Codeforces 148D 一袋老鼠 Bag of mice | 概率DP 水题

    除非特别忙,我接下来会尽可能翻译我做的每道CF题的题面! Codeforces 148D 一袋老鼠 Bag of mice | 概率DP 水题 题面 胡小兔和司公子都认为对方是垃圾. 为了决出谁才是垃 ...

  6. Codeforces Round #359 (Div. 2) A. Free Ice Cream 水题

    A. Free Ice Cream 题目连接: http://www.codeforces.com/contest/686/problem/A Description After their adve ...

  7. Codeforces Testing Round #12 A. Divisibility 水题

    A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...

  8. Codeforces Round #334 (Div. 2) A. Uncowed Forces 水题

    A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/pro ...

  9. Codeforces Round #115 B. Plane of Tanks: Pro 水题

    B. Plane of Tanks: Pro Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/17 ...

随机推荐

  1. myeclipse中导入的jquery文件报错(出现红叉叉,提示语法错误)

    转自:http://blog.csdn.net/simplty/article/details/7661504

  2. Redis系列-存储篇hash主要操作函数小结

    阳光透过玻璃,洒在身上,一杯暖茶在手,说不尽的安逸自得,让我有种想再写篇blog的冲动.上篇主要谈了string,这里谈谈hash吧!hash是一些列key value(field value)的映射 ...

  3. win7 MS SQL SERVER 2000安装

    http://blog.chinaunix.net/uid-24398518-id-2156226.html MicrosoftInternetExplorer402DocumentNotSpecif ...

  4. [转] Linux内核代码风格 CodingStyle [CH]

    from:http://blog.csdn.net/jiang_dlut/article/details/8163731 中文版维护者: 张乐 Zhang Le <r0bertz@gentoo. ...

  5. 虚拟机安装Centos版本的linux

    选择自定义安装,然后一路确定下去,对了,Centos的版本一定要高,比如centos 6,太低安装会出问题

  6. Mac下为我们开发的App制作gif动画演示(不仅仅针对开发者,想做gif图片的也可参考)

    趁着工作不忙,就闲着倒腾自己的事情,把自己写的一个完整App<丁丁印记>整理了一番,总结其中用到的技术和实现的功能,并想把一些用到的技术分享给各位工友们,因为我自学iOS开发得益于大家的分 ...

  7. IOS 导航栏属性设置

    IOS 7 以上系统导航栏: [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; // 返回按钮颜色 [UINaviga ...

  8. linux下的deb/rpm文件的说明和安装方法

    1.    deb 是 ubuntu .debian 的格式.    rpm 是 redhat .fedora .suse 的格式. 他们不通用(虽然可以转换一下). deb是debian发行版的软件 ...

  9. CentOS中配置LNMP环境打开提示File not found

    在centos系统中配置好php环境了,但是发现能运行html页面并不能运行php文件了,这样我就在gg的帮助下一步不解决了,下面来看问题的具体解决过程.     安装之后测试发现,怎么Html能运行 ...

  10. JS 基于面向对象的 轮播图1

    ---恢复内容开始--- 1 'use strict' 2 function Tab(id){ 3 if(!id)return; 4 this.oBox = document.getElementBy ...