当前位置:网站首页>L2-007 Family property (use of vector, set, map)
L2-007 Family property (use of vector, set, map)
2022-07-30 15:42:00 【The real question is OK】
Given each person's family members and the real estate in their own name, please count the population, per capita real estate area and real estate units of each family.
input format:
Enter the first line to give a positive integer N (≤1000), followed by N lines, each of which gives a person's property in the following format:
No. Parent k Child 1 ... Child k Number of Property Units Total AreaWhere number is a 4-digit number unique to each person; parent and parent are the person corresponding to the number respectively's parent's number (-1 if deceased); k (0≤k≤5) is that person's child'snumber; child i is the number of its child.
Output format:
First output the number of families on the first line (all people who are related belong to the same family).The information for each household is then output in the following format:
Minimum number of family members Household population Number of property units per capita Property area per capitaThe per capita value requires 3 decimal places.The household information is first output in descending order of per capita area, and if there are parallels, it is output in ascending order of member number.
Input sample:
106666 5551 5552 1 7777 1 1001234 5678 9012 1 0002 2 3008888 -1 -1 0 1 10002468 0001 0004 1 2222 1 5007777 6666 -1 0 2 3003721 -1 -1 1 2333 2 1509012 -1 -1 3 1236 1235 1234 1 1001235 5678 9012 0 1 502222 1236 2468 2 6661 6662 1 3002333 -1 3721 3 6661 6662 6663 1 100Example output:
38888 1 1.000 1000.0000001 15 0.600 100.0005551 4 0.750 100.000#include #include #include #include #include 边栏推荐
- 被捧上天的Scrum敏捷管理为何不受大厂欢迎了?
- Sleuth+Zipkin(可视化) 服务链路追踪
- Our company has used gateway services for 6 years, dynamic routing, authentication, current limiting, etc., a stable batch!
- TiUP terms and core concepts
- B+树索引页大小是如何确定的?
- 转换OTU表和序列文件为PICRUST2需要的格式
- GeoServer + openlayers
- tiup clean
- Classes and Objects (Part 2)
- golang modules initialization project
猜你喜欢
随机推荐
TiUP 简介
Lock wait timeout exceeded solution
Flask入门学习教程
Flink实时仓库-DWS层(关键词搜索分析-自定义函数,窗口操作,FlinkSql设置水位线,保存数据到Clickhouse)模板代码
MySql error: SqlError(Unable to execute query", "Can't create/write to file OS errno 2 - No such file...
定时任务 corn
【云原生 • DevOps】influxDB、cAdvisor、Grafana 工具使用详解
Alluxio for Presto fu can across the cloud self-service ability
About the data synchronization delay of MySQL master-slave replication
嵌入式开发:嵌入式基础知识——正确启动固件项目的 10 条建议
Core Topics under Microservice Architecture (2): Design Principles and Core Topics of Microservice Architecture
B+树索引页大小是如何确定的?
481-82(105、24、82、34、153)
Sentinel
【云原生】服务行业案例-不可预测的并发场景解决方案
Sleuth+Zipkin(可视化) 服务链路追踪
golang图片处理库image简介
Mysql database query is very slow. Besides the index, what else can be caused?
【嵌入式】适用于Cortex-M3(STM32F10x)的IQmath库
MASM32v11编程调用Process32First失败: 程序发出命令,但命令长度不正确








