https://pintia.cn/problem-sets/994805260223102976/problems/994805270356541440
这道题是真麻烦
#include <iostream>
using namespace std;
struct t{
int maxs, maxc, cc, cnt = 0;
string correct;
};
t test[1002];
int main(){
int N, M, score[1002] = {0};
cin >> N >> M;
for(int i = 0; i < M; i++){
cin >> test[i].maxs >> test[i].maxc >> test[i].cc;
getline(cin, test[i].correct);
}
for(int i = 0; i < N; i++){
for(int j = 0; j < M; j++){
string s = "";
char c;
c = getchar();
while(c != '(')
c = getchar();
while(c == '('){
c = getchar();
int m = c-'0';
for(int k = 0; k < 2*m; k++){
c = getchar();
s += c;
}
}
if(s == test[j].correct)
score[i] += test[j].maxs;
else
test[j].cnt++;
}
}
for(int i = 0; i < N; i++)
cout << score[i] << endl;
int tmpm = 0, tmpsub, flag = 0;
for(int i = 0; i < M; i++){
if(test[i].cnt > tmpm){
tmpsub = i;
tmpm = test[i].cnt;
}
}
if(!tmpm) cout << "Too simple";
else{
cout << tmpm;
for(int i = 0; i < M; i++){
if(test[i].cnt == tmpm)
cout << " " << i+1;
}
}
return 0;
}