摘要: 模板题不多说,字符处理部分有人使用一个函数转化,我直接在主函数里转化的。把地点名转化成对应的点。能到输出最短路,不能到输出-1,但是容易遗漏的是,有可能起点与终点相同,输出0。。。#include#include#include#include#define INF 200000000int dis[151],visit[151],map[151][151],t;void dij(int a,int b){ int i,j,min,v; memset(visit,0,sizeof(visit)); for(i=1;itime) { ... 阅读全文
posted @ 2013-08-17 20:07 奇葩朵朵开 阅读(229) 评论(0) 推荐(0)
摘要: 直接套用dijstra算法,记得更新花费。这题被坑了,同一条路居然有不同的距离和花费,所以赋值map的时候就要注意了,记得更新呀。。。#include#include#define INF 200000000int map[1001][1001],mapc[1001][1001],visit[1001],dist[1001],cost[1001],n;int dijstra(int s,int t){ int i,j,k,min,min1,v; memset(visit,0,sizeof(visit)); for(i=1;id) { ... 阅读全文
posted @ 2013-08-17 11:25 奇葩朵朵开 阅读(183) 评论(0) 推荐(0)
摘要: V -Regular WordsTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1502DescriptionConsider words of length 3n over alphabet {A, B, C} . Denote the number of occurences of A in a word a as A(a) , analogously let the number of occurence... 阅读全文
posted @ 2013-08-12 15:23 奇葩朵朵开 阅读(463) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1024 G -Max Sum Plus PlusTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 1024DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challeng 阅读全文
posted @ 2013-08-11 10:53 奇葩朵朵开 阅读(219) 评论(0) 推荐(0)
摘要: Bone Collector IITime Limit : 5000/2000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 19Accepted Submission(s) : 17Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have see 阅读全文
posted @ 2013-08-02 15:58 奇葩朵朵开 阅读(218) 评论(0) 推荐(0)
摘要: SupermarketTime Limit : 4000/2000ms (Java/Other)Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 20Accepted Submission(s) : 11Problem DescriptionA supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an i 阅读全文
posted @ 2013-07-25 15:23 奇葩朵朵开 阅读(169) 评论(0) 推荐(0)