1073 多选题常见计分法 (20 分)

#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    int alpha[5]={1,2,4,8,16};
    int opt[1000][1000]={0};
    vector<int> fullScroe(m), trueOpt(m);
    vector<vector<int> >error(m);
    int allOptNum,trueOptNum;
    int maxError=0;
    for(int i=0;i<m;i++){
        cin>>fullScroe[i]>>allOptNum>>trueOptNum;
        for(int j=0;j<trueOptNum;j++){
            char c;
            cin>>c;
            trueOpt[i]+=alpha[c-'a'];
        }
        error[i].resize(5);
    }
    for(int i=0;i<n;i++){
        double grade=0.0;
        for(int j=0;j<m;j++){
            getchar();
            getchar();
            int temp;
            cin>>temp;
            for(int k=0;k<temp;k++){
                char c;
                cin>>c;
                opt[i][j]+=alpha[c-'a'];
            }
            getchar();
            int e;
            e=opt[i][j]^trueOpt[j];
            if(e){
                if((opt[i][j] | trueOpt[j])==trueOpt[j]){
                    grade+=fullScroe[j]*1.0/2;
                }
                if(e & alpha[0]) error[j][0]++;
                if(e & alpha[1]) error[j][1]++;
                if(e & alpha[2]) error[j][2]++;
                if(e & alpha[3]) error[j][3]++;
                if(e & alpha[4]) error[j][4]++;
            }else{
                grade+=fullScroe[j];
            }
        }
        printf("%.1lf\n",grade);
    }
    for(int i=0;i<m;i++){
        for(int j=0;j<5;j++){
            maxError=maxError>error[i][j]? maxError:error[i][j];
        }
    }
    if(maxError==0){
        printf("Too simple");
    }else{
        for(int i=0;i<m;i++){
            for(int j=0;j<5;j++){
                if(maxError==error[i][j]){
                    printf("%d %d-%c\n",maxError,i+1,'a'+j);
                }
            }
        }
    }
    return 0;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值