Title: give you some characters, ask can compose several margarita.
Analysis: Simple questions. Direct statistical calculation is possible.
Description: Recent state is somewhat unstable ╮(╯▽╰)╭.
#include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include < Cstdio> #include <cmath>using namespace Std;int main () {int N,count[6];char buf[606];while (~scanf ("%d", &n) {for (int i = 0; i < n; + + i) {scanf ("%s", buf), for (int j = 0; J < 6; + + j) Count[j] = 0;for (int j = 0; buf [j]; + + j) {if (buf[j] = = ' M ') + count[0];if (buf[j] = = ' A ') + count[1];if (buf[j] = = ' R ') + count[2];if (buf[j] = = ' G ') + + Count[3];if (buf[j] = = ' I ') + count[4];if (buf[j] = = ' T ') + + count[5];} COUNT[1]/= 3; COUNT[2]/= 2;int min = 606;for (int j = 0; J < 6; + + j) if (Min > count[j]) min = count[j];p rintf ("%d\n", Min);}} return 0;}
UVa 12626-i? Pizza