上一页 1 ··· 10 11 12 13 14
摘要: 这题就是从1到n点进行遍历,对未加热的点找到最远的能加热到这个点的点,还是看代码讲吧 #include"bits/stdc++.h" using namespace std; const int inf=0x3f3f3f3f; typedef long long LL; int a[1005],an 阅读全文
posted @ 2018-10-14 19:28 Jathon-cnblogs 阅读(342) 评论(0) 推荐(0) 编辑
摘要: #include"bits/stdc++.h" using namespace std; struct tree{ tree* Next[26]; int cnt; }*root; tree* init(){ tree* t=(tree*)malloc(sizeof(tree)); memset(t 阅读全文
posted @ 2018-10-02 22:08 Jathon-cnblogs 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 由于这道题目数据范围小,所以属于水题。可以采取暴力的做法来解决。 代码如下: #include"bits/stdc++.h" using namespace std; const int maxn=65535; bool tag[maxn+5]; vector<int>v;int n; bool j 阅读全文
posted @ 2018-09-24 22:13 Jathon-cnblogs 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 迪杰斯特拉算法--O(n^2) #include"iostream" #include"cstring" #include"cstdio" using namespace std; const int inf = 0x3f3f3f3f; typedef long long LL; int map[1 阅读全文
posted @ 2018-09-20 21:20 Jathon-cnblogs 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 快速幂(本代码中的^表示次幂不是异或) Accepted 1061 0MS 1368K 679 B G++ #include "bits/stdc++.h" using namespace std; const int MOD = 10; int quick_pow(int n, int m) { 阅读全文
posted @ 2018-09-20 16:33 Jathon-cnblogs 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 字典树解法(Trie树) Accepted 1251 156MS 45400K 949 B C++ #include"iostream" #include"cstdlib" #include"cstring" #include"cstdio" using namespace std; struct 阅读全文
posted @ 2018-09-19 20:28 Jathon-cnblogs 阅读(168) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14