There are several test points in pat Class B 1015 that have been unable to pass, and we can't find out what the problem is.

topic description

1015 Theory of Virtue and Talent (25 points)
Song Dynasty historian Sima Guang has a famous "theory of Virtue and Talent" in "Zi Zhi Tongjian": "it is the sage of talent and virtue, the fool of virtue and death, the gentleman of virtue, and the villain of virtue. The art of taking a man is not like a saint or a gentleman, and it is not like a fool to get a villain. "

now give a group of examinees" moral and talent scores, please give the admission ranking according to Sima Guang"s theory.

input format:
enter the first line to give three positive integers, respectively: n ( 105mm), that is, the total number of candidates; L ( 60), the lowest score line for admission, that is, candidates whose moral and talent scores are not less than L are eligible to be considered for admission; H (< 100), the priority admission line-- the moral score and talent score are not lower than this line is defined as "complete moral integrity". This kind of candidates are sorted according to the total score from high to low. A class of candidates who can not get a moral score but get a line belong to "virtue wins talent", which is also sorted by the total score, but ranks after the first category examinee; the moral and talent score is lower than H, but the examinee whose moral score is not lower than the talent score belongs to "both ability and virtue", but the candidates who still have "virtue victory talent" are sorted by the total score, but they are ranked after the second class examinee; other candidates who reach the lowest line L are also sorted by the total score, but after the third category examinee.

then N lines, each line gives the examinee"s information, including: the admission card number is divided into 8-digit integers, which is divided into integers in the interval [0,100]. Numbers are separated by spaces.

output format:
the first line of the output first gives the number of candidates who reach the lowest score line M, then the M line, each line outputs the information of one examinee according to the input format, and the candidates are sorted from high to low according to the rules described in the input. When there are many candidates whose total scores are the same, they will be arranged in descending order according to their moral scores; if they are also juxtaposed, they will be output according to the ascending order of the admission card number.
input sample:
14 60 80
10000001 64 90
10000002 90 60
10000011 85 80
10000003 85 80
10000004 80 85
10000005 82 77
10000006 83 76
10000007 90 78
10000008 75 79
10000009 59 90
10000010 88 45
10000012 80 100
10000013 90 99
10000014 66 60
output sample:
12
10000013 90
1000001280
1000000385 < 80 br > 1000001185
100000048090
100000078090
1000000683
10005000 77
10000009060 br < 10000066 br < 10000013 < 79 > 10000064 > 10000064 >

sources of topics and their own ideas

my own idea is to put the four types of candidates directly into stu [], and then sort and output them respectively. The program passes the test samples, but a few fail

.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

-sharpinclude <cstdio>
-sharpinclude <vector>
-sharpinclude <algorithm>

using namespace std;

struct Student{
    int id;
    int de;
    int cai;
    int score;//
};

vector<struct Student> stu[4];//

bool cmp(Student a,Student b){
    if(a.score!=b.score) return a.score>b.score;
    else if(a.de!=b.de) return a.de>b.de;
    else return a.id<b.id;
}
int main(){
    int N,L,H;//
    int m=0;//
    Student temp;
    scanf("%d%d%d",&N,&L,&H);
    for(int i=0;i<N;iPP){
        scanf("%d%d%d",&temp.id,&temp.de,&temp.cai);
        if(temp.de<L||temp.cai<L) continue;//
        mPP;//+1
        temp.score = temp.de+temp.cai;//
        if(temp.de>=H){//
            if(temp.cai>=H){//
                stu[0].push_back(temp);
                continue;
            }else {//
                stu[1].push_back(temp);
                continue;
            }
        }
        if(temp.de>temp.cai){//,
            stu[2].push_back(temp);
            continue;
        }
        stu[3].push_back(temp);//
    }

    printf("%d\n",m);//
    for(int i=0;i<4;iPP){
      if(stu[i].size()>0){
          sort(stu[i].begin(),stu[i].end(),cmp);//
          for(int j=0;j<stu[i].size();jPP){//
              temp = stu[i][j];
              printf("%d %d %d\n",temp.id,temp.de,temp.cai);
          }
      }
    }

    return 0;
}

what result do you expect? What is the error message actually seen?

clipboard.png

CPP
May.26,2022

Germany is no less than talent. Is > =

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf056f-31cf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf056f-31cf8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?