Codeforces Testing Round #8 B. Sheldon and Ice Pieces 水题
题目链接: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 水题的更多相关文章
- 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 ...
- Codeforces Beta Round #14 (Div. 2) C. Four Segments 水题
C. Four Segments 题目连接: http://codeforces.com/contest/14/problem/C Description Several months later A ...
- Codeforces Beta Round #14 (Div. 2) B. Young Photographer 水题
B. Young Photographer 题目连接: http://codeforces.com/contest/14/problem/B Description Among other thing ...
- Codeforces Beta Round #6 (Div. 2 Only) A. Triangle 水题
A. Triangle 题目连接: http://codeforces.com/contest/6/problem/A Description Johnny has a younger sister ...
- Codeforces 148D 一袋老鼠 Bag of mice | 概率DP 水题
除非特别忙,我接下来会尽可能翻译我做的每道CF题的题面! Codeforces 148D 一袋老鼠 Bag of mice | 概率DP 水题 题面 胡小兔和司公子都认为对方是垃圾. 为了决出谁才是垃 ...
- 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 ...
- Codeforces Testing Round #12 A. Divisibility 水题
A. Divisibility Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/probl ...
- 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 ...
- 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 ...
随机推荐
- mac 下隐藏和显示文件
显示:defaults write com.apple.finder AppleShowAllFiles -bool true隐藏:defaults write com.apple.finder Ap ...
- LTP学习
下载LTP源码和模型文件: https://github.com/linux-test-project/ltp 官方说明文档 http://ltp.readthedocs.org/zh_CN/late ...
- 蓝桥杯 algo——6 安慰奶牛 (最小生成树)
问题描述 Farmer John变得非常懒,他不想再继续维护供奶牛之间供通行的道路.道路被用来连接N个牧场,牧场被连续地编号为1到N.每一个牧场都是一个奶牛的家.FJ计 划除去P条道路中尽可能多的道路 ...
- 后台框架--HUI 的学习跟使用1
下载跟查看说明文档:官方 https://github.com/jackying/ 官网:http://www.h-ui.net/H-ui.admin.shtml 后台,http://www.h-ui ...
- Google search
filetype: active directory filetype: eg : lady gaga filetype:mp3 link: eg : link : supinfo.com(链接到su ...
- MATLAB图像处理函数汇总(一)
1.applylut功能: 在二进制图像中利用lookup表进行边沿操作.语法:A = applylut(BW,lut)举例lut = makelut('sum(x(:)) == 4',2);BW1 ...
- sourcetree使用问题汇总
1.可优先查阅博文<git 用户手册 1.5.3及后续版本使用>: 2.问题1 Cloning into 'folder'... warning: templates not found ...
- arguments.callee
arguments.callee在哪个函数中运行,他就代表哪个函数,一般在匿名函数中.在匿名函数中有时需要自己调用自己,但是由于是匿名函数,没有名字,所以可以用arguments.callee来代替匿 ...
- self进行weak化
创建block匿名函数之前一般需要对self进行weak化,否则造成循环引用无法释放controller: __weak MyController *weakSelf = self 或者 __weak ...
- php大力力 [015节]兄弟连高洛峰php教程(土豆网栏目地址)
兄弟连高洛峰php教程 兄弟连高洛峰php教程(土豆网栏目地址) [2014]兄弟连高洛峰 PHP教程1.1.1 新版视频形式介绍 [2014]兄弟连高洛峰 PHP教程1.1.2 BS结构软件类型介绍 ...