- 3 4
- 3 4 2 a c
- 2 5 1 b
- 5 3 2 b c
- 1 5 4 a b d e
- (2 a c) (2 b d) (2 a c) (3 a b e)
- (2 a c) (1 b) (2 a b) (4 a b d e)
- (2 b d) (1 e) (2 b c) (4 a b c d)
- 3
- 6
- 5
- 2 2 3 4
- #include
- using namespace std;
- struct Title{
- long key=0,score=0,wrong=0; // 答案,该题分数,错的人数
- }title[101];
- int main()
- {
- vector<long> maxMistaken; // 结果储存
- long N,M,a,b,c,max=0; // max 当前单个题目错的最多的人数
- char ch,s[1001];
- cin >> N >> M;
- for(int z=1;z<=M;z++){
- cin >> a >> b >> c;
- while (c--){
- cin >> ch;
- title[z].key = title[z].key*10 + ch;
- }
- title[z].score = a;
- }
-
-
- getchar();
- while (N--){
- long sum=0,answer=0;
- cin.getline(s,1001);
- for(int z=1,z1=1;z1<=M;z++){
- if(s[z]>='a' && s[z]<='e') answer = answer*10 + s[z];
- if(s[z]==')')
- {
- if(answer == title[z1].key) sum+=title[z1].score;
- else
- {
- title[z1].wrong += 1;
- if(title[z1].wrong > max) maxMistaken.clear();
- if(title[z1].wrong >= max) {
- max = title[z1].wrong;
- maxMistaken.push_back(z1);
- }
- }
- answer=0;
- z1++;
- }
- }
- cout << sum << endl;
- }
-
- if(maxMistaken.empty()) cout << "Too simple" << endl;
- else cout << max;
- sort(maxMistaken.begin(),maxMistaken.end());
- for(long x:maxMistaken) cout << " " << x;
- return 0;
- }