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 }