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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
#include <iostream> #include <cstdio> #include <map> #include <algorithm> const int MAXM = 101;
struct question { int total_score, num_option, cor_num_option; int cor_option[105] = {0}; int err_option[105] = {0}; }quest[MAXM];
using namespace std; int main() { int N, M; scanf("%d%d", &N, &M); for(int i = 0; i < M; i++) { scanf("%d%d%d", &quest[i].total_score, &quest[i].num_option, &quest[i].cor_num_option); for(int j = 0; j < quest[i].cor_num_option; j++) { char tmp; cin >> tmp; quest[i].cor_option[tmp] = 1; } } for(int i = 0; i < N; i++) { double score_count = 0.0; for(int j = 0; j < M; j++) { while(getchar() != '('); int num, flag = 0; scanf("%d",&num); int tmp[105] = {0}; for(int k = 0; k < num; k++) { char t; cin >> t; tmp[t] = 1; if(quest[j].cor_option[t] == 0) { flag = 1; } } for(int k = 'a'; k <= 'e'; k++) { if(quest[j].cor_option[k] != tmp[k]) { quest[j].err_option[k]++; } } if(flag == 0) { if(num == quest[j].cor_num_option) { score_count += quest[j].total_score; } else { score_count += (double)quest[j].total_score / 2; } } } printf("%.1lf\n", score_count); } int maxnum = quest[0].err_option['a']; for(int i = 0; i < M; i++) { for(int j = 'a'; j <= 'e'; j++) { if(maxnum < quest[i].err_option[j]) { maxnum = quest[i].err_option[j]; } } } if(maxnum == 0) { printf("Too simple\n"); } else { for(int i = 0; i < M; i++) { for(int j = 'a'; j <= 'e'; j++) { if(maxnum == quest[i].err_option[j]) { printf("%d %d-%c\n", maxnum, i + 1, j); } } } } return 0; }
|