摘要: 1.引用同一个文件中的变量 2.引用不同文件中的变量 3.引用不同文件中的函数(需要指明返回类型和参数) 阅读全文
posted @ 2017-08-19 10:02 diamondDemand 阅读(3960) 评论(0) 推荐(0) 编辑
摘要: 使用并查集 参考:http://blog.csdn.net/sinat_30126425/article/details/51901934 #include <iostream>#include <stdio.h>#include <string.h>#include <algorithm>usin 阅读全文
posted @ 2017-08-17 18:05 diamondDemand 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 参考自:http://blog.csdn.net/u013615904/article/details/51424123 #include<iostream>#include<vector>#include<queue>#include<cstring>#include<cstdio>const i 阅读全文
posted @ 2017-08-16 19:49 diamondDemand 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 很简单,不说了 #include<iostream>#include<iomanip>#include <string.h>#include <stdio.h>using namespace std;int main(){ char num[52]; cin >> num; int NumOfTwo 阅读全文
posted @ 2017-08-16 16:29 diamondDemand 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 要注意的问题:当b正好是一行的最后一个数时,会输出两个空格,这就是错误点 #include <iostream>#include <stdio.h>#include <vector>#include <map>#include <list>using namespace std; int main( 阅读全文
posted @ 2017-08-16 16:08 diamondDemand 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/qsort_/article/details/51833704 #include <cstdio>#include <algorithm>#include <iostream>#include <set> using namespace std; in 阅读全文
posted @ 2017-08-16 09:16 diamondDemand 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 参考:https://www.liuchuo.net/archives/2155,牛逼的同志,此致敬礼 #include <iostream>#include <vector>using namespace std;vector<int> post;vector<int> pre;bool isMi 阅读全文
posted @ 2017-08-15 11:47 diamondDemand 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h>#include <algorithm>using namespace std;struct mooncake{float price;float reserve;float allPrice;bool operator < 阅读全文
posted @ 2017-08-14 18:11 diamondDemand 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 代码参考自:http://blog.csdn.net/xunalove/article/details/64923723 这位老铁的思路还是比较巧妙的,只要拿到每条链表对应的头结点,就可以实现输出。Key是绝对值不超过104的整数,key[;10000+1]; 这个地方会有测试点,如果空间不够大,则 阅读全文
posted @ 2017-08-13 15:46 diamondDemand 阅读(723) 评论(0) 推荐(0) 编辑
摘要: dijkstra算法比较复杂,看了好一阵才算完全弄明白,如果不了解算法就来看代码,真的很蛋疼,应该先完全了解dijkstra算法,然后知道这类问题的不同情况,以下列出,然后根据套路来看代码,就会容易很多 求最短路径的条数 counts[s] = 1; 如果找到更短路: count[w] = coun 阅读全文
posted @ 2017-08-12 20:44 diamondDemand 阅读(280) 评论(0) 推荐(0) 编辑