当前位置:网站首页>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 边栏推荐
- Sentinel
- How is the B+ tree index page size determined?
- 面试何惧调优!腾讯技术官私藏的性能优化方案手册,原理实战齐全
- Core Topics under Microservice Architecture (2): Design Principles and Core Topics of Microservice Architecture
- 难道Redis真的变慢了吗?
- TensorFlow自定义训练函数
- Flink本地UI运行
- Classes and Objects (Part 2)
- [Cloud Native] Service Industry Case - Solutions for Unpredictable Concurrency Scenarios
- Could not acquire management access for administration
猜你喜欢
![[Cloud native] Grayscale release, blue-green release, rolling release, grayscale release explanation](/img/90/f7d85ac655d9206fefbd28e0fc81ba.png)
[Cloud native] Grayscale release, blue-green release, rolling release, grayscale release explanation

ISELED---氛围灯方案的新选择

Flask入门学习教程

JVM performance tuning

数据库-SQL

哨兵

Configuration - Notes

Redis cache penetration, breakdown, avalanche and consistency issues
4 senior experts share the insider architecture design and implementation principles of Flink technology with years of experience in large factories

481-82(105、24、82、34、153)
随机推荐
解析字符串拼接的两种情况
面试何惧调优!腾讯技术官私藏的性能优化方案手册,原理实战齐全
Flask之路由(app.route)详解
[Cloud native] Alibaba Cloud ARMS business real-time monitoring
软件包 - 笔记
【嵌入式】适用于Cortex-M3(STM32F10x)的IQmath库
L2-007 家庭房产(vector、set、map的使用)
MySql error: SqlError(Unable to execute query", "Can't create/write to file OS errno 2 - No such file...
JHM:芳环羟化双加氧酶数据库DARHD建立及相关引物评价
Flink实时仓库-DWS层(关键词搜索分析-自定义函数,窗口操作,FlinkSql设置水位线,保存数据到Clickhouse)模板代码
70行代码撸一个桌面自动翻译神器
微服务架构下的核心话题 (二):微服务架构的设计原则和核心话题
About the data synchronization delay of MySQL master-slave replication
Introduction to TiUP
【云原生】服务行业案例-不可预测的并发场景解决方案
华为「天才少年」计划招募的博士们,迎来首秀!
Sparse-PointNet: See Further in Autonomous Vehicles 论文笔记
Configuration - Notes
针对 MySQL/InnoDB 刷盘调优
Installing and Uninstalling MySQL on Mac