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

查网站注册信息遵义企业做网站

查网站注册信息,遵义企业做网站,站外推广网站,种子搜索引擎题目大意#xff1a; 有编号1#xff5e;P的站点#xff0c; 有Q条公交车路线#xff0c;公交车路线只从一个起点站直接 到达终点站#xff0c;是单向的#xff0c;每条路线有它自己的车费。有P个人早上从1出发 #xff0c;他们要到达每一个公交站点#xff0c; 然后到…题目大意 有编号1P的站点 有Q条公交车路线公交车路线只从一个起点站直接 到达终点站是单向的每条路线有它自己的车费。有P个人早上从1出发 他们要到达每一个公交站点 然后到了晚上再返回点1。 求所有人来 回的最小费用之和。 分析与总结: 依题意去的时候用单源最短路算法便可求出去时的最小总花费。但是回 来的时候不好办是从各个点到达指定的点1最小花费。如果对于每个点 求一次最短路那么肯定会超时。这时候根据逆向思维反向的再重新建 立图即原先是u--v 变成v--u再用单源最短路算法求出1到所有点 的最短路即可。 队列跑dijkstra反向建图邻接表下标过大输入输出用stdio(iostream超时) In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They have printed invitation cards with all the necessary information and with the programme. A lot of students were hired to distribute these invitations among the people. Each student volunteer has assigned exactly one bus stop and he or she stays there the whole day and gives invitation to people travelling by bus. A special course was taken where students learned how to influence people and what is the difference between influencing and robbery.  The transport system is very special: all lines are unidirectional and connect exactly two stops. Buses leave the originating stop with passangers each half an hour. After reaching the destination stop they return empty to the originating stop, where they wait until the next full half an hour, e.g. X:00 or X:30, where X denotes the hour. The fee for transport between two stops is given by special tables and is payable on the spot. The lines are planned in such a way, that each round trip (i.e. a journey starting and finishing at the same stop) passes through a Central Checkpoint Stop (CCS) where each passenger has to pass a thorough check including body scan.  All the ACM student members leave the CCS each morning. Each volunteer is to move to one predetermined stop to invite passengers. There are as many volunteers as stops. At the end of the day, all students travel back to CCS. You are to write a computer program that helps ACM to minimize the amount of money to pay every day for the transport of their employees.  Input The input consists of N cases. The first line of the input contains only positive integer N. Then follow the cases. Each case begins with a line containing exactly two integers P and Q, 1 P,Q 1000000. P is the number of stops including CCS and Q the number of bus lines. Then there are Q lines, each describing one bus line. Each of the lines contains exactly three numbers - the originating stop, the destination stop and the price. The CCS is designated by number 1. Prices are positive integers the sum of which is smaller than 1000000000. You can also assume it is always possible to get from any stop to any other stop. Output For each case, print one line containing the minimum amount of money to be paid each day by ACM for the travel costs of its volunteers. Sample Input 2 2 2 1 2 13 2 1 33 4 6 1 2 10 2 1 60 1 3 20 3 4 10 2 4 5 4 1 50 Sample Output 46 210 #includeiostream #includestdio.h #includestring.h #includealgorithm #includequeue using namespace std; #define inf 0x3f3f3f3f const int mm1e6; int dp[mm10],a[mm10],b[mm10],c[mm10]; int t,m,n,f[mm10],ne[mm10],book[mm10]; void dfs(int x) {memset(book,0,sizeof(book));memset(dp,inf,sizeof(dp));queueintq;while(!q.empty())q.pop();q.push(x);book[x]1;dp[x]0;while(!q.empty()){int kq.front();q.pop();book[k]0;for(int if[k]; i!-1; ine[i])if(dp[b[i]]dp[a[i]]c[i]){dp[b[i]]dp[a[i]]c[i];if(!book[b[i]]){book[b[i]]1;q.push(b[i]);}}} } int main() {scanf(%d,t);while(t--){memset(f,-1,sizeof(f));/*care*/scanf(%d%d,m,n);for(int i0; in; i){scanf(%d%d%d,a[i],b[i],c[i]);ne[i]f[a[i]];f[a[i]]i;}dfs(1);long long ans0;for(int i1; im; i)ansdp[i];memset(f,-1,sizeof(f));/*care*/for(int i0; in; i)/*反向建图*/{swap(a[i],b[i]);ne[i]f[a[i]];f[a[i]]i;}dfs(1);for(int i1; im; i)ansdp[i];printf(%lld\n,ans);}return 0; }
http://wiki.neutronadmin.com/news/138047/

相关文章:

  • 网站制作常见的问题电子商务网站经营特色分析的主要内容包括
  • 访问网站出现目录wordpress 管理员账号在哪里查询
  • 网站云空间和普通空间山西省网站建设
  • 关于申请建设网站申请报告重庆建筑公司100强
  • 做网站客户给不了素材win7 iis配置本地网站
  • 网站建设取得了购买空间网站哪个好
  • 建设工程质量协会网站俄罗斯网站建设
  • 做网站怎样实现网上支付怎么样做小程序
  • jsp网站建设作业dedecms 门户网站制作
  • 贵阳市乌当区住房与城乡建设局网站娃哈哈网络营销策划方案
  • wordpress企业网站开发视频网站后台
  • 威海高区有没有建设局的网站网站开发简答题
  • 做线上网站的风险分析网站设计 版权
  • 广东建设工程招标网站专业建设 验收 网站
  • 代理网站开发金山网站安全检测
  • php访问网站网站建设 广州佛山
  • 网站迁移后 后台进不去简单网站建设方案策划
  • 深圳积分商城网站制作怎样做类似淘宝的网站
  • 深圳建站软件红酒首页网页设计素材
  • 制作网站的软件有那个免费我的世界做头像的网站
  • 网站开发计入什么会计科目网络运营招聘
  • 机械技术支持 东莞网站建设制作网站和制作网页的分别
  • 定制公司网站百度指数人群画像哪里查询
  • 建服务网站需要多少钱遵义软件制作平台
  • 旅游信息网站开发背景陕西网站建设优化建站
  • 北京市建设厅门户网站wordpress回复邮件
  • 画品展现手机网站android wap网站
  • 建设通网站上的业绩能否有用wordpress钩子自定义钩子
  • 下载建设银行官方网站下载免费发布信息
  • 百度收录好的网站排名专业开发软件的公司