The main topic: small A have some trouble, now ask you to go to him to solve.
Idea: The basic problem of grammar.
CODE:
#include <cstdio> #include <string> #include <cstring> #include <iostream> #include < Algorithm> #define MAX 1010using namespace std; int total,m;string Ans[max],name;int Cnt[max]; int main () { cin >> total; for (int num,i = 1; I <= total; ++i) { cin >> num >> name; Ans[0] + = name; m = max (m,num); memset (cnt,0,sizeof (CNT)); for (int j = 1; j <= Num; ++j) { string temp; Cin >> temp; ANS[J] + = temp; for (String::iterator it = Temp.begin (); It! = Temp.end (); ++it) cnt[j] + = *it = ', '; } int _max = *max_element (cnt + 1,cnt + num + 1); for (int j = 0; j < MAX; ++j) for (int k = cnt[j]; k <= (i = = Total _max-1:_max); ++k) ans[j] + = ', ';
} for (int i = 0; I <= m; ++i) cout << ans[i] << Endl; return 0;}
Why is the problem of JL so weak!!
Bzoj 2760 jloi 2011 Small A's trouble simulation