TOJ 2119 Tangled in Cables】的更多相关文章

描述 You are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start your business properly and are relying on parts you have found in an old warehouse you bought. Among your fin…
简单的最小生成树,不过中间却弄了很久,究其原因,主要是第一次做生成树,很多细节不够熟练,find()函数的循环for判断条件是 pre[i]>=0,也就是遇到pre[i]==-1时停止,i就是并查集的代表元. #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #define MAXN 1000 #define MAXE 1000010 #define LEN…
/** 题意:     给你两个城市之间的道路(无向图),求出需要的     电缆.如果大于所提供的,就输出Not enough ...     否则输出所需要的电缆长度.       输入:N (给定的电缆总长度)           m1 (有多少个城市—)           str1           str2           str3           str4           :           :(城市的名字)             m2(相当于给出m2条边)  …
http://poj.org/problem?id=2075 题目大意: 给你一些人名,然后给你n条连接这些人名所拥有的房子的路,求用最小的代价求连接这些房子的花费是否满足要求. 思路: 昨天20分钟的题,输入不小心写错了- -|||||看世界杯半场歇息随便看了下发现了....T T 用map进行下标的映射,然后求MST就可以. c++ #include<cstdio> #include<string> #include<map> #include<algorit…
Tangled in Cables Time Limit: 2 Seconds      Memory Limit: 65536 KB You are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start your business properly and are relying on pa…
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1019 Grandpa's Other Estate 1034 Simple Arithmetics 1036 Complete the sequence! 1043 Maya Calendar 1054 Game Prediction 1057 Mileage Bank 1067 Rails 10…
POJ图论分类[转] 一个很不错的图论分类,非常感谢原版的作者!!!在这里分享给大家,爱好图论的ACMer不寂寞了... (很抱歉没有找到此题集整理的原创作者,感谢知情的朋友给个原创链接) POJ:http://poj.org/ 1062* 昂贵的聘礼 枚举等级限制+dijkstra 1087* A Plug for UNIX 2分匹配 1094 Sorting It All Out floyd 或 拓扑 1112* Team Them Up! 2分图染色+DP 1125 Stockbroker…
Tangled in Cables Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6348   Accepted: 2505 Description You are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start…
2119: 股市的预测 Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 331  Solved: 153[Submit][Status][Discuss] Description 墨墨的妈妈热爱炒股,她要求墨墨为她编写一个软件,预测某只股票未来的走势.股票折线图是研究股票的必备工具,它通过一张时间与股票的价位的函数图像清晰地展示了股票的走势情况.经过长时间的观测,墨墨发现很多股票都有如下的规律:之前的走势很可能在短时间内重现!如图可以看到这只股票A…
TOJ 2776题目链接http://acm.tju.edu.cn/toj/showp2776.html 这题其实就是考虑的周全性...  贡献了好几次WA, 后来想了半天才知道哪里有遗漏.最大的问题就是, 当零头是13的时候, 不一定前面的光盘都刻录到最大值.比如29,16这种情况, 如果前面的刻录最大值,这样就需要3个盘,而最少的却是 2个就够了,(15,14) 即可:知道这种情况,这题基本就可以了: 注意一下这几个数据: 13 15 输出为2 29 16 输出为2 这条题目看起来很容易,但…