我的个人网站 Cheese的个人主页http://www.cheese.ren/
博客来源 PAT 乙级 1053 住房空置率-Cheese的个人博客http://blog.cheese.ren/73
欢迎交换友链 :-)
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, d, v=0, p_v=0, day, v_day;
double e, e_day;
cin >> n >> e >> d;
for (int i=0; i<n; i++) {
v_day = 0;
cin >> day;
for (int l=0; l<day; l++) {
cin >> e_day;
if (e_day < e) {
v_day++;
}
}
if ((double)v_day / day > 0.5) {
if (day > d) {
v++;
}
else {
p_v++;
}
}
}
printf("%.1lf%% %.1lf%%\n", (double)p_v/n*100, (double)v/n*100);
return 0;
}