Advertisement
arfin97

Codecraft-17 and Codeforces Round #391 A solution

Jan 12th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5.     string str;
  6.     cin.sync();
  7.     getline(cin, str);
  8.     int len = str.length();
  9.     string bulb = "Bulbasaur";
  10.     int ara[7] = {0, 0, 0, 0, 0, 0, 0};
  11.     for(int i = 0; i < len; i++){
  12.         if(str[i] == 'B') ara[0]++;
  13.         if(str[i] == 'l') ara[1]++;
  14.         if(str[i] == 'b') ara[2]++;
  15.         if(str[i] == 's') ara[3]++;
  16.         if(str[i] == 'r') ara[4]++;
  17.         if(str[i] == 'a') ara[5]++;
  18.         if(str[i] == 'u') ara[6]++;
  19.     }
  20.     ara[5] = ara[5]/2;
  21.     ara[6] = ara[6]/2;
  22.  
  23.     int pokemon = ara[0];
  24.     for(int i = 0; i < 7; i++){
  25.         if(ara[i] < pokemon){
  26.             pokemon = ara[i];
  27.         }
  28.     }
  29.     cout << pokemon << endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement