python 1058 选择题 (20 分)

第一个测试点提示”非零返回“,其余的通过,可有大佬帮忙看一下

n,m = map(int,input().split(" "))
topic_list = []
ipt_list1 = []
ipt_list2 = []
error_list = []
for i in range(m):
    error_list.append(0)
    ipt_list1 = list(map(str,input().split(" ")))
    topic_list.append(ipt_list1)
#topic_list = [['3', '4', '2', 'a', 'c'], ['2', '5', '1', 'b'], ['5', '3', '2', 'b', 'c'], ['1', '5', '4', 'a', 'b', 'd', 'e']]
for i in range(n):
    grade = 0
    ipt_list2 = list(map(str,input().split(") (")))
    ipt_list2[0] = ipt_list2[0][1:]
    ipt_list2[-1] = ipt_list2[-1][:-1]
    for j in range(m):
        if topic_list[j][2] != ipt_list2[j][0]:
            error_list[j] += 1
            continue
        else:
            str1 = "".join((topic_list[j])[3:])
            str2 = (ipt_list2[j][1:]).replace(" ","")
            if str1 == str2:
                grade = grade + int(topic_list[j][0])
            else:
                error_list[j] += 1
    print(grade)
max_value = max(error_list)
if max_value == 0:
    print("Too simple")
else:
    print(max_value,end="")
    for i in range(m):
        if error_list[i] == max_value:
            print(" "+str(i+1),end="")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值