日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【CF#757A】Gotta Catch Em' All!

發布時間:2023/12/10 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【CF#757A】Gotta Catch Em' All! 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題干:

Bash wants to become a Pokemon master one day. Although he liked a lot of Pokemon, he has always been fascinated by Bulbasaur the most. Soon, things started getting serious and his fascination turned into an obsession. Since he is too young to go out and catch Bulbasaur, he came up with his own way of catching a Bulbasaur.

Each day, he takes the front page of the newspaper. He cuts out the letters one at a time, from anywhere on the front page of the newspaper to form the word?"Bulbasaur"?(without quotes) and sticks it on his wall. Bash is very particular about case?— the first letter of?"Bulbasaur"?must be upper case and the rest must be lower case. By doing this he thinks he has caught one Bulbasaur. He then repeats this step on the left over part of the newspaper. He keeps doing this until it is not possible to form the word?"Bulbasaur"?from the newspaper.

Given the text on the front page of the newspaper, can you tell how many Bulbasaurs he will catch today?

Note:?uppercase and lowercase letters are considered different.

Input

Input contains a single line containing a string?s?(1??≤??|s|??≤??105)?— the text on the front page of the newspaper without spaces and punctuation marks.?|s|?is the length of the string?s.

The string?s?contains lowercase and uppercase English letters, i.e.?.

Output

Output a single integer, the answer to the problem.

Examples InputBulbbasaur Output1 InputF Output0 InputaBddulbasaurrgndgbualdBdsagaurrgndbb Output2 Note

In the first case, you could pick:?Bulbbasaur.

In the second case, there is no way to pick even a single Bulbasaur.

In the third case, you can rearrange the string to?BulbasaurBulbasauraddrgndgddgargndbb?to get two words "Bulbasaur".


解題報告:

????水題不解釋。

ac代碼:

#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; const int MAX = 1e5+5; char str[MAX]; int B,u,l,b,a,s,r; int Min(int a,int b,int c,int d,int e,int f,int g) {int cmp[7]={a,b,c,d,e,f,g};return *min_element(cmp,cmp+7); } int main() {scanf("%s",str);int len=strlen(str);for(int i = 0; i<len; i++) {switch (str[i]){case 'B' : B++;break;case 'u' : u++;break;case 'l' : l++;break;case 'b' : b++;break;case 'a' : a++;break;case 's' : s++;break;case 'r' : r++;break;}}a/=2;u/=2;printf("%d\n",Min(B,u,l,b,a,s,r));return 0 ;} //Bulbasaur


總結

以上是生活随笔為你收集整理的【CF#757A】Gotta Catch Em' All!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。