1053 住房空置率

题目传送门

#include <iostream>
using namespace std;
int main() 
{
	int n, d, k, may = 0, must = 0;
	double e, t;
	cin >> n >> e >> d;
	for (int i = 0; i < n; i++) 
	{
		cin >> k;
		int sum = 0;
		for (int j = 0; j < k; j++) 
		{
			cin >> t;
			if (t < e) 
			{
				sum++;
			}
		}
		if (sum > (k / 2)) 
		{
			k > d ? must++ : may++;
		}
	}
	double x = (double)may / n * 100;
	double y = (double)must / n * 100;
	printf("%.1f%% %.1f%%", x, y);
	return 0;
}
上一篇:Simple Reaction Controller


下一篇:COMP9313 - 2019T2