代码
#include <stdio.h>
int main() {
int n, D;
double e;
scanf("%d %lf %d", &n, &e, &D);
double re1 = 0;
double re2 = 0;
for(int i=0; i<n; i++){
int K;
scanf("%d", &K);
double count = 0;
for(int j=0; j<K; j++){
double t;
scanf("%lf", &t);
if(t<e){
count += 1;
}
}
if(K>D && count/K>0.5){
re2++;
}
else if(count/K>0.5){
re1++;
}
}
printf("%.1lf%% %.1lf%%\n", re1/n*100.0, re2/n*100.0);
return 0;
}
注解
1、注意输入输出格式即可。
2、理解题目意思,何为“可能空置”、何为“空置”。