首先给出自己做法,也是大多数的做法,但是最后一个测试点死活过不去,考虑到是两个for循环占用了绝大多数时间。后来再看题目时,发现分数是百分制,最后解决
#include<stdio.h>
#include<stdlib.h>
int main() {
int studentNumber;
scanf("%d", &studentNumber);
int* studentPointer = calloc(sizeof(int), studentNumber);
int i,j;
for (i = 0; i < studentNumber; i++)
scanf("%d", (studentPointer + i));
int queryNumber;
scanf("%d"