题意:顺序给出选手id,题目id, score表示选手第几道题得了多少分,要求按总得分降序,总ac题数降序,id升序排序。
正常模拟即可。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node{
int id, acNum, subNum, s;
int p[10];
} student;
student st[10040];
student ans[10040];
int fullmark[10];
int n, k, m, cnt;
int max(int x, int y){
if(x >= y) return x;
else return y;
}
int cmp(const void* a, const void* b){
student* u = (student*) a;
student* v = (student*) b;
if(u -> s != v -> s) return ((u -> s) - (v -> s)