上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: 时间限制:0.25s空间限制:4M题意: 在n(1const int INF = 300 + 9;int g[INF][INF], f[INF][INF];int n, m, i, j, k, t;int main() { scanf ("%d%d", &n, &m); t = (m + 1) ... 阅读全文
posted @ 2014-08-13 14:12 keambar 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 一道题目长的水题。。。。总结就一句话,给出n个(-3~3)的数,一个数m,取任意个数是使这些数的m次幂之和最大。code#include #include using namespace std;int n, m, x;int g[7];int main() { cin >> n >> m; for... 阅读全文
posted @ 2014-08-11 16:38 keambar 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 时间限制:0.25s空间限制:6M;题意: 按照AB, AC, AD, BC, BD, CD.给出一个空间四面体的6条边长。求出它的体积。Solution: 欧拉四面体公式: http://blog.csdn.net/archibaldyangfan/article/de... 阅读全文
posted @ 2014-08-11 16:09 keambar 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 时间限制:0.5s空间限制6M题意: 给出n个(1int n, m, x;int g[10009], pr[1009][2], f[1009][2];void write (int x) { if (pr[x][0] != 0) write (pr[x][0]); printf ("%d ", ... 阅读全文
posted @ 2014-08-11 15:54 keambar 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 时间限制:0.5s空间限制:6M题意: 在b(2#include #include #include #include #include using namespace std;int b, n;struct node { int s[2009]; bool operator 0; i--)... 阅读全文
posted @ 2014-08-11 14:40 keambar 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 一道简单题。火车停的位置不是在整点就是在二分之一点,坐标*2,然后枚举火车停的位置,计算总距离即可。code:#include #include #include #include #include #define INF 309using namespace std;int L, m, n, x,... 阅读全文
posted @ 2014-08-11 12:27 keambar 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 时间限制:0.25s空间限制:6M题目描述 让我们想象一个无向图G=.如果边(u,v)在边集E中,那么我们就说两个顶点u和v是邻接点.在这种情况下,我们也说u是v的一个邻接点且v是u的一个邻接点.我们用N(v)表示点v的邻接点集合.我们知道v的邻接点数目也叫作这个点的度,用deg v表示.我们说... 阅读全文
posted @ 2014-08-08 14:07 keambar 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 题意: 给出一个m叉树的前,后序遍历求这样的树有多少种。Solution: 我们知道前序遍历的第一个点一定是根节点,后序遍历的最后一个点一定是根节点。 由此,我们只一要确定对于每一个节点,它有多少个儿子节点,再累乘C(m,k)。code#include #include #in... 阅读全文
posted @ 2014-07-27 10:51 keambar 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题意: 树的前,中序遍历求后序遍历。基础题。code#include #include using namespace std;string sq, sh;int len;void make (int l, int r, int t, int w) { if (l > r || t > w) r... 阅读全文
posted @ 2014-07-27 10:05 keambar 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 分析: 2*n个小朋友,每个最多有n-1个"敌人",显然是存在哈密顿回路的. 预处理边,然后找哈密顿回路.code#include #include #include #include #include using namespace std;#define pb push_back#def... 阅读全文
posted @ 2014-07-25 23:31 keambar 阅读(333) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页