A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each friend might or might not receive money from any or all of the other friends. Your goal in this problem is to deduce how much more money each person gives than they receive.

The rules for gift-giving are potentially different than you might expect. Each person sets aside a certain amount of money to give and divides this money evenly among all those to whom he or she is giving a gift. No fractional money is available, so dividing 3 among 2 friends would be 1 each for the friends with 1 left over -- that 1 left over stays in the giver's "account".

In any group of friends, some people are more giving than others (or at least may have more acquaintances) and some people have more money than others.

Given a group of friends, no one of whom has a name longer than 14 characters, the money each person in the group spends on gifts, and a (sub)list of friends to whom each person gives gifts, determine how much more (or less) each person in the group gives than they receive.

IMPORTANT NOTE

The grader machine is a Linux machine that uses standard Unix conventions: end of line is a

usaco Greedy Gift Givers (送礼物)相关推荐

  1. USACO Training Section 1.1 贪婪的送礼者Greedy Gift Givers

    P1201 [USACO1.1]贪婪的送礼者Greedy Gift Givers 题目描述 对于一群(NP个)要互送礼物的朋友,GY要确定每个人送出的钱比收到的多多少.在这一个问题中,每个人都准备了一 ...

  2. 贪婪的送礼者Greedy Gift Givers [USACO 1.2]

    贪婪的送礼者Greedy Gift Givers [USACO 1.2]题目描述: 有一群(N个)要互送礼物的朋友,现在要确定每个人送出的钱比收到的钱多多少.每个人都准备了一些钱来送礼物,而这些钱将会 ...

  3. USACO题解——Section 1.2——Greedy Gift Givers

    题目地址:https://train.usaco.org/usacoprob2?a=BGOMbIJsisd&S=gift1. 或者我的OJ网站,http://47.110.135.197/pr ...

  4. Greedy Gift Givers

    原题地址 Greedy Gift Givers A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange g ...

  5. [USACO1.1]贪婪的送礼者Greedy Gift Givers

    题目描述 对于一群(NP个)要互送礼物的朋友,GY要确定每个人送出的钱比收到的多多少.在这一个问题中,每个人都准备了一些钱来送礼物,而这些钱将会被平均分给那些将收到他的礼物的人.然而,在任何一群朋友中 ...

  6. USACO1.1.2 - Greedy Gift Givers

    贪婪礼品送货员 一组NP(2≤NP≤10)唯一命名的朋友决定交换礼物的钱.这些朋友中的每一个可能或可能不会给任何或所有其他朋友一些钱.同样,每个朋友可能或可能不从任何或所有其他朋友接收钱.你在这个问题 ...

  7. USACO Section 1.2 Greedy Gift Givers (简单查找)

    2018-3-25 changed 题目大意就是说我们要互相 " 送钱 " ,一共NP个人,指定某一个人将sum这么多的钱分给num个人,那么这些人每个人多了sum/num,送钱的 ...

  8. YTU ---1402-Greedy Gift Givers 贪婪的送礼者

    1402: 1.1.2 Greedy Gift Givers 贪婪的送礼者 Time Limit: 1 Sec   Memory Limit: 64 MB Submit: 31   Solved: 1 ...

  9. JSOI 2015 送礼物

    [BZOJ4476] [JSOI2015]送礼物 Description JYY和CX的结婚纪念日即将到来,JYY来到萌萌开的礼品店选购纪念礼物. 萌萌的礼品店很神奇,所有出售的礼物都按照特定的顺序都 ...

  10. 中科大博士20万字正经论文:教你如何给女朋友送礼物

    杨净 萧箫 发自 凹非寺 量子位 报道 | 公众号 QbitAI 这是一篇迟来的送礼攻略. 也是一篇正经的论文解读. 中科大博士20万字,136页论文教你如何给女朋友送礼物. 这项研究是从1012对未 ...

最新文章

  1. 《Java程序设计》第十一周学习总结
  2. 八张图彻底了解JDK8 GC调优秘籍!
  3. 读大话数据结构之二--------算法(上)
  4. 高可用与负载均衡(7)之聊聊Lvs-DR+Keepalived的解决方案
  5. kettle mysql 分页_kettle 分页抽数
  6. 知乎高赞:自控力极差的人如何自救?
  7. 新建一个虚拟环境 用于django的项目
  8. RequestDispatcher对象的应用-请求转发
  9. (原)Lazarus 异构平台下多层架构思路、DataSet转换核心代码
  10. [裴礼文数学分析中的典型问题与方法习题参考解答]4.3.24
  11. bzoj3884: 上帝与集合的正确用法 扩展欧拉定理
  12. Qt 实现Windows系统Win10 c++音量调节
  13. matlab做班级抽签,matlab抽签程序(含源码)
  14. jrtplib的使用
  15. 机器之心的进化 / 理解 AI 驱动的软件 2.0 智能革命
  16. 你不知道的京东数据库运维自动化体系建设之路
  17. Labview2018视频教程(共51节)
  18. 程序员在囧途之火葬场惊魂14天
  19. 一分钟完全关闭Antimalware Service Executable(windows defender)任务管理器程序
  20. Qt Q_UNUSED使用

热门文章

  1. html5实现圆圈里带一个三角形,CSS3 画基本图形,圆形、椭圆形、三角形等
  2. CIO40: 全渠道新零售大中台
  3. 鸡兔同笼 百翁百钱 水仙花数
  4. UE4版本的罗技方向盘驱动插件升级为UE5版本,及相应出现的问题
  5. JAVA SE — Day 17
  6. [转载]在RHEL系统上使用“subscription-manager”注册和激活“subscription”
  7. 【Java语言自制词典翻译小工具(自己的词典,简单好用)】
  8. Failed to setup local dir C:/hadoop-2.7.7/workplace/tmp/nm-local-dir, which was marked as good
  9. 下列功能中python不具备的是_智慧职教云课堂2020Python程序设计(常州工业职业技术学院)章节测验答案...
  10. 分级诊疗,移动互联网在画饼还是良药?