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

水题~

 1 #include <cstdio>
 2 #include <cstdlib>
 3 #include <cstring>
 4 char n[10], a[202]; 
 5 int  b[13], c[13];
 6 int main(void) {
 7     //freopen("in.txt", "r", stdin);
 8     scanf("%s%s", n, a);
 9     int len1 = strlen(n), len2 = strlen(a);
10     memset(b, 0, sizeof(b)); memset(c, 0, sizeof(c));
11     for (int i = 0; i < len1; ++i) b[n[i]-'0']++;
12     for (int i = 0; i < len2; ++i) c[a[i]-'0']++;
13     b[2]+=b[5], b[5]=0, c[2]+=c[5], c[5]=0, b[6]+=b[9], b[9]=0, c[6]+=c[9], c[9]=0;
14     int cnt=0, Max=100000;
15     for (int i = 0; i < 10; ++i){
16         if (b[i]){
17 cnt = c[i]/b[i]; if (cnt < Max) Max = cnt;
18         }
19     }
20     printf("%d\n", Max);
21     return 0;
22 }

=_=

相关文章:

  • 2021-08-28
  • 2021-12-25
  • 2022-01-11
  • 2021-05-31
  • 2021-08-28
  • 2022-03-08
  • 2021-12-14
猜你喜欢
  • 2021-09-05
  • 2022-01-15
  • 2022-01-18
  • 2021-11-16
  • 2021-06-23
  • 2021-09-25
  • 2022-01-23
相关资源
相似解决方案