1000

每天只要复习收益最大的那门课即可

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <stdlib.h>
 4 #include <algorithm>
 5 #include <iostream>
 6 #include <queue>
 7 #include <stack>
 8 #include <vector>
 9 #include <map>
10 #include <set>
11 #include <string>
12 #include <math.h>
13 using namespace std;
14 #pragma warning(disable:4996)
15 typedef long long LL;                   
16 const int INF = 1<<30;
17 /*
18 */
19 const int N = 100 + 10;
20 int dp[N][N];
21 int a[N][N];
22 char in[] = "D:\\3\\1004\\0.in";
23 char out[] = "D:\\3\\1004\\0.out";
24 char str[] = "0123456789";
25 int main()
26 {
27     //for (int z = 0; z <= 9; ++z)
28     {
29         //in[10] = str[z];
30         //out[10] = str[z];
31         //freopen(in, "r", stdin);
32         //freopen(out, "w", stdout);
33         int n, m;
34         while (scanf("%d%d", &n, &m) != EOF)
35         {
36             for (int i = 1; i <= n; ++i)
37             {
38                 for (int j = 1; j <= m; ++j)
39                     scanf("%1d", &a[i][j]);
40             }
41 
42             int ans = 0;
43             for (int i = 1; i <= n; ++i)
44             {
45                 sort(a[i] + 1, a[i] + n + 1);
46                 ans += a[i][n];
47             }
48             printf("%d\n", ans);
49         }
50     }
51     return 0;
52 }
View Code

相关文章:

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