-
Notifications
You must be signed in to change notification settings - Fork 0
/
1058_choice.cpp
57 lines (56 loc) · 1.36 KB
/
1058_choice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <cstdio>
#include <vector>
#include <set>
using namespace std;
int main() {
int n, m, temp, k;
scanf("%d%d", &n, &m);
vector<set<char> > right(m);
vector<int> total(m), wrongCnt(m);
for(int i = 0; i < m; i++) {
scanf("%d%d%d", &total[i], &temp, &k);
for(int j = 0; j < k; j++) {
char c;
scanf(" %c", &c);
right[i].insert(c);
}
}
for(int i = 0; i < n; i++) {
int score = 0;
scanf("\n");
for(int j = 0; j < m; j++) {
if(j != 0) scanf(" ");
scanf("(%d", &k);
set<char> st;
char c;
for(int l = 0; l < k; l++) {
scanf(" %c", &c);
st.insert(c);
}
scanf(")");
if(st == right[j]) {
score += total[j];
} else {
wrongCnt[j]++;
}
}
printf("%d\n", score);
}
int maxWrongCnt = 0;
for(int i = 0; i < m; i++) {
if(wrongCnt[i] > maxWrongCnt) {
maxWrongCnt = wrongCnt[i];
}
}
if(maxWrongCnt == 0)
printf("Too simple");
else {
printf("%d", maxWrongCnt);
for(int i = 0; i < m; i++) {
if(wrongCnt[i] == maxWrongCnt) {
printf(" %d", i + 1);
}
}
}
return 0;
}