zoukankan      html  css  js  c++  java
  • PTA乙级 (1058 选择题 (20分))

    1058 选择题 (20分)

    https://pintia.cn/problem-sets/994805260223102976/problems/994805270356541440

     1 #include <iostream>
     2 #include <cstdio>
     3 #include <cstring>
     4 #include <string>
     5 #include <cmath>
     6 #include <algorithm>
     7 using namespace std;
     8 int main()
     9 {
    10     int n,m;
    11     int i,j,k,sum=0;
    12     bool flag=true;
    13     int full_score[102],count_opt[102],count_corropt[102],temp,a[102]={0};
    14     char chr[102][7],stu_chr[102][7],chr1;
    15     cin>>n>>m;
    16     for(i=0;i<m;i++)
    17     {
    18         cin>>full_score[i]>>count_opt[i]>>count_corropt[i];
    19         for(j=0;j<count_corropt[i];j++) cin>>chr[i][j];
    20     }
    21     for(i=0;i<n;i++)
    22     {
    23         sum=0;
    24         for(k=0;k<m;k++){
    25         flag=true;
    26         cin>>chr1>>temp;
    27         if(temp!=count_corropt[k]) flag=false;
    28         for(j=0;j<temp;j++){
    29             cin>>stu_chr[k][j];
    30             if((stu_chr[k][j]!=chr[k][j])&&(flag==true)) flag=false; 
    31         } 
    32         if(flag) sum+=full_score[k];
    33         else if(!flag)
    34         {
    35             a[k+1]++;
    36          } 
    37         cin>>chr1;
    38         }
    39         cout<<sum<<endl;
    40     }
    41     int max=-1; 
    42     for(i=1;i<=m;i++)
    43     {
    44         if(a[i]>max) max=a[i];
    45     }
    46     if(max==0) cout<<"Too simple
    ";
    47     else{
    48         cout<<max;
    49         for(i=1;i<=m;i++)
    50          if(a[i]==max) cout<<" "<<i;
    51     }
    52     return 0;
    53 }
    天晴了,起飞吧
  • 相关阅读:
    wkhtmktopdf
    linux命令行抓取网页快照
    ubuntu 固定静态IP
    $http questions
    generate_scripts
    network
    IT_Qestion
    day03
    day02
    day01
  • 原文地址:https://www.cnblogs.com/jianqiao123/p/12227470.html
Copyright © 2011-2022 走看看