第一次用这个网站的看USACO分类的“关于USACO“,,肯定有用,不然你会死在某些你想吐血的地方

Greedy Gift Givers

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 single character often known as ‘\n’. This differs from Windows, which ends lines with two charcters, ‘\n’ and ‘\r’. Do not let your program get trapped by this!

PROGRAM NAME: gift1

INPUT FORMAT

USACO Section1.1 Greedy Gift Givers相关推荐

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

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

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

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

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

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

  4. Greedy Gift Givers

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

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

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

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

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

  7. USACO1.1.2 - Greedy Gift Givers

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

  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. USACO 1.0_Greedy Gift Givers

    2019独角兽企业重金招聘Python工程师标准>>> /* ID: zfb2 LANG: C++ TASK: gift1 */ #include <iostream> ...

  10. USACO 2017 December Contest Platinum T3: Greedy Gift Takers

    题目大意 有 N(1≤N≤1e5)头牛按顺序排成一列,编号从 1 到 N,1 号牛在队头,N 号牛在队尾. 每次位于队头的牛 i 拿到一个礼物,然后插入到从队尾数ci​头牛之前的位置..举个栗子: 初 ...

最新文章

  1. 零基础入门--中文命名实体识别(BiLSTM+CRF模型,含代码)
  2. linux抓源地址,【Linux】apt-get 源地址汇总
  3. 项目中遇到的ORA error 及解决办法 ---ora-07445
  4. 餐厅点餐系统:测试与部署
  5. 中秋逢国庆 | 盛世华诞 阖家团圆
  6. [转载] Java单例模式与构造器私有化
  7. RTT设置删除空闲钩子函数想到函数指针和回调函数
  8. Mad Libs 游戏
  9. Linux多线程编程[精]
  10. vc2008编译libjpeg
  11. 来自一个包工头的创业故事
  12. java单例的生命周期_Spring Bean生命周期详解
  13. 游戏服务器开发都要学什么
  14. 中国图形图象学报和计算机科学,《中国图象图形学报》编辑部
  15. Linux 文件颜色代表含义
  16. PhantomJS+Selenium+Scrapy抓取巨潮资讯网企业信息
  17. Flume Kafka Channel使用案例
  18. asp.net 获取网页源文件的方法
  19. xftp无法取消被动模式
  20. python 的 int() 函数

热门文章

  1. 导航页的开发--手机web app开发笔记(四)
  2. 02-Jenkins配置Kubernetes
  3. JVM参数中的 -、-X、-XX、-D、-Javaagent:
  4. 产业洞察 |都在说数据资产管理,那数据资产到底是什么
  5. 怎样用计算机对图形图像处理,计算机图形图像处理技巧图形设计论文(全文完整版)...
  6. 龙芯软件开发 5 --北桥南桥芯片的作用
  7. 年终奖(全年一次性奖金)的个人所得税计算方法
  8. 【转载】C++的cout高阶格式化操作
  9. 网站爱好者的必备软件
  10. Segmentation Fault错误