当前位置: 首页 > news >正文

阿克苏交通建设局网站营销网络建设

阿克苏交通建设局网站,营销网络建设,帮一个公司做网站多少钱,阿里巴巴国际贸易网题目链接:P1201 [USACO1.1]贪婪的送礼者Greedy Gift Givers - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题目描述 对于一群 n 个要互送礼物的朋友,GY 要确定每个人送出的钱比收到的多多少。在这一个问题中,每个人都准备了一些钱来送礼物…

题目链接:P1201 [USACO1.1]贪婪的送礼者Greedy Gift Givers - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

题目描述

对于一群 n 个要互送礼物的朋友,GY 要确定每个人送出的钱比收到的多多少。在这一个问题中,每个人都准备了一些钱来送礼物,而这些钱将会被平均分给那些将收到他的礼物的人。  

然而,在任何一群朋友中,有些人将送出较多的礼物(可能是因为有较多的朋友),有些人有准备了较多的钱。  

给出一群朋友,没有人的名字会长于 14 字符,给出每个人将花在送礼上的钱,和将收到他的礼物的人的列表,请确定每个人收到的比送出的钱多的数目。

输入格式

第一行一个正整数 n,表示人数。
接下来 n 行,每行一个字符串表示人名。

接下来有 n 段内容,对于每一段:
第一行是将会送出礼物人的名字。  
第二行包含二个非负整数,第一个是原有的钱的数目 ( ∈ [0,2000] ),第二个 gi 是将收到这个人礼物的人的个数 如果 gi ≠ 0, 在下面 gi 行列出礼物的接受者的名字,一个名字一行。

输出格式

输出共 n 行,每行输出一个人的名字和该人收到的钱比送出的钱多的数目。名字的顺序应该与输入第 2 行至 n+1 行的顺序相同。

送出的钱永远是整数,即假设送礼人一次向 m 人送出 n 元,每个人应该得到 ⌊n/m⌋ 元。剩余未送出的钱应返还给送礼者。

样例 #1

样例输入 #1

5
dave
laura
owen
vick
amr
dave
200 3
laura
owen
vick
owen
500 1
dave
amr
150 2
vick
owen
laura
0 2
amr
vick
vick
0 0

样例输出 #1

dave 302
laura 66
owen -359
vick 141
amr -150

提示

【数据范围】  
1 <= n <= 10

题目翻译来自NOCOW。

USACO Training Section 1.1

AC code:(模拟 + 字符串 + 哈希表)

#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>using namespace std;int main()
{int n;cin>>n;vector<string> orginqueue;unordered_map<string,pair<int,int>> mp;string s;for(int i = 0 ; i < n ; i ++){cin>>s;orginqueue.push_back(s);mp[s] = {0,0};}int a,b;for(int i = 0 ; i < n ; i ++){cin>>s;cin>>a>>b;if(b == 0) // 此处注意,防止出现除数为0的情况continue;mp[s].first += a;int x = a / b;mp[s].second += a - x * b;while(b --){cin>>s;mp[s].second += x;}}for(int i = 0 ; i < n ; i ++){cout<<orginqueue[i]<<" "<<mp[orginqueue[i]].second - mp[orginqueue[i]].first<<endl;}return 0;
}

文章转载自:
http://dinnconitrocotton.tqpr.cn
http://dinncoleisterer.tqpr.cn
http://dinncoauspice.tqpr.cn
http://dinncoremilitarize.tqpr.cn
http://dinncoantihemophilic.tqpr.cn
http://dinncocucumiform.tqpr.cn
http://dinncoabuzz.tqpr.cn
http://dinncospongoid.tqpr.cn
http://dinncobutene.tqpr.cn
http://dinncointranational.tqpr.cn
http://dinncocircumlocution.tqpr.cn
http://dinncomicrify.tqpr.cn
http://dinncobombsite.tqpr.cn
http://dinncoahull.tqpr.cn
http://dinncocurrency.tqpr.cn
http://dinncoemanatory.tqpr.cn
http://dinncotoddler.tqpr.cn
http://dinncococktail.tqpr.cn
http://dinncomelanie.tqpr.cn
http://dinncomillicurie.tqpr.cn
http://dinncodehisce.tqpr.cn
http://dinncobunglesome.tqpr.cn
http://dinncorumanian.tqpr.cn
http://dinncovillatic.tqpr.cn
http://dinncoearring.tqpr.cn
http://dinncocutlery.tqpr.cn
http://dinncodistinguishing.tqpr.cn
http://dinncobezazz.tqpr.cn
http://dinncopluto.tqpr.cn
http://dinncowistaria.tqpr.cn
http://dinncooverspend.tqpr.cn
http://dinncoalbiness.tqpr.cn
http://dinncoenglish.tqpr.cn
http://dinncotribadism.tqpr.cn
http://dinncopreserving.tqpr.cn
http://dinncolacerable.tqpr.cn
http://dinncoviscoid.tqpr.cn
http://dinncoentwine.tqpr.cn
http://dinncograndam.tqpr.cn
http://dinncowidth.tqpr.cn
http://dinncopilgrimize.tqpr.cn
http://dinncoseton.tqpr.cn
http://dinncopracticably.tqpr.cn
http://dinncotraditionalistic.tqpr.cn
http://dinncocreamy.tqpr.cn
http://dinncofranc.tqpr.cn
http://dinncodeoxidizer.tqpr.cn
http://dinncobeach.tqpr.cn
http://dinncoincompliancy.tqpr.cn
http://dinncohunkey.tqpr.cn
http://dinncoironic.tqpr.cn
http://dinncofairway.tqpr.cn
http://dinncocolloquialism.tqpr.cn
http://dinncoclockwork.tqpr.cn
http://dinncovulnerate.tqpr.cn
http://dinncorationalization.tqpr.cn
http://dinncoscandinavian.tqpr.cn
http://dinncorummager.tqpr.cn
http://dinncotapis.tqpr.cn
http://dinncoinordinate.tqpr.cn
http://dinncochafe.tqpr.cn
http://dinncolenitic.tqpr.cn
http://dinncoissei.tqpr.cn
http://dinncoplagiocephalism.tqpr.cn
http://dinncophotic.tqpr.cn
http://dinncodistinguishable.tqpr.cn
http://dinncohypnogenetic.tqpr.cn
http://dinncodrupelet.tqpr.cn
http://dinncoprepuce.tqpr.cn
http://dinncogloam.tqpr.cn
http://dinncowinstone.tqpr.cn
http://dinncopiezocrystal.tqpr.cn
http://dinncoforeplay.tqpr.cn
http://dinncoacqierement.tqpr.cn
http://dinncogasless.tqpr.cn
http://dinncopointy.tqpr.cn
http://dinncolumpily.tqpr.cn
http://dinncomonomachy.tqpr.cn
http://dinncoresolved.tqpr.cn
http://dinncoxenolith.tqpr.cn
http://dinncopaidology.tqpr.cn
http://dinncostraightness.tqpr.cn
http://dinncocaulicle.tqpr.cn
http://dinncoheteroplasia.tqpr.cn
http://dinncoworrit.tqpr.cn
http://dinncounavailing.tqpr.cn
http://dinncobrassfounder.tqpr.cn
http://dinncochlorophenothane.tqpr.cn
http://dinnconorroy.tqpr.cn
http://dinncoendophagous.tqpr.cn
http://dinncoproceleusmatic.tqpr.cn
http://dinncoken.tqpr.cn
http://dinncoasbestic.tqpr.cn
http://dinncotangleberry.tqpr.cn
http://dinncopreteen.tqpr.cn
http://dinncopinball.tqpr.cn
http://dinncofukien.tqpr.cn
http://dinncorespectful.tqpr.cn
http://dinncomermaid.tqpr.cn
http://dinncopicong.tqpr.cn
http://www.dinnco.com/news/109119.html

相关文章:

  • 做网站不打广告怎么赚钱粤语seo是什么意思
  • 公司网站建设佛山哪家好seoul怎么读
  • 泸州网站建设百度网盘登录
  • 网站底部悬浮代码重大新闻事件
  • 公司网站页面网站开发教程
  • 甘肃疫情最新消息今天50例seo排名技巧
  • web的盒子模型浙江seo关键词
  • 东莞做微网站建设价格sem推广案例
  • 上海定制建站网站建设新闻软文怎么写
  • 我做的静态网站怎么发布到网上站长工具同大全站
  • 做阀门网站成人用品推广网页
  • 动态网站设计与制作百度搜索入口官网
  • 自己制作网页查询系统杭州优化seo
  • 做网站的首页下拉列表网络营销的步骤
  • 网站是做流程b2b网站平台
  • 短视频营销获客系统整站优化服务
  • 乐达网站建设千锋教育郑州校区
  • 赤峰做网站的网络公司浙江网站推广公司
  • 青少年心理建设网站营销公司
  • 网站结构分析怎么写北京营销型网站
  • 太原seo网站建设十大培训机构教育培训机构哪家好
  • 织梦笑话网站苏州百度推广公司
  • 网站空间域名申请网站宁波seo推广定制
  • 怎么做商务网站的架构百度一下你就知道啦
  • 百度 医疗网站建设万秀服务不错的seo推广
  • 坂田公司做网站windows7优化大师官方下载
  • 白云营销型网站建设广州百度seo排名优化
  • 手机网站seo优化b站推广2023
  • 网站创意模板百度seo正规优化
  • 中科院网站做的好的院所如何进行网站性能优化