如果程序里面有错误,希望大家能够批评指正!#include#include#include#include#define WIN 256 // 可以修改决定游戏输赢的值// 矩阵数组int num[4][4]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};int t[5]={0...
分类:
编程语言 时间:
2014-07-11 08:47:34
阅读次数:
230
用邻接矩阵写的。自己慢慢理解吧#include #include using namespace std;#define CC(c) memset(c, 0, sizeof(c))const int maxn=5000;int iscut[maxn], g[maxn][maxn], low[maxn...
分类:
其他好文 时间:
2014-07-11 08:45:04
阅读次数:
206
http://202.121.199.212/JudgeOnline/problem.php?cid=1078&pid=17
分析: 直接暴力了。。。
代码:
#include
#include
using namespace std;
#define MAXN 2004
#define inf 0x3f3f3f3f
int k[MAXN],f[MAXN];
in...
分类:
其他好文 时间:
2014-07-11 00:47:06
阅读次数:
223
听说2048游戏实现起来很easy!
所以今天就试了试!确实不太难,要想编的很成功,也不是太容易!有很多细节需要考虑!
下面是我自己设计的代码,估计里面会漏洞百出!希望路过大神能指点一二!
#include
#include
#include
#include
#define WIN 256 // 可以修改决定游戏输赢的值
// 矩阵数组
int num[4][4]={0,0,0,0,0,...
分类:
编程语言 时间:
2014-07-11 00:17:42
阅读次数:
492
题目大意:
n波人去k*k的电影院看电影。
要尽量往中间坐,往前坐。
直接枚举,贪心,能坐就坐,坐在离中心最近的地方。
#include
#include
#include
#include
#define maxn 1000005
#define lowbit(x) (x&(-x))
using namespace std;
struct BI...
分类:
其他好文 时间:
2014-07-10 22:52:57
阅读次数:
262
d[i]=cost[i]-ans*dis[0][i]
据此二分。
但此题用Dinkelbach迭代更好
#include
#include
#include
#include
#include
using namespace std;
#define N 1010
double mp[N][N],c[N][N],x[N],y[N],z[N],e[N][N],d[N];
int vi...
分类:
其他好文 时间:
2014-07-10 21:48:32
阅读次数:
199
有的时候,我们需要调用纯c++的方法,这个时候,我们必须再次封装一下。通过调用中间层对象的方法,来调用c++的方法。请看下图:
2.在test.h文件中定义方法
#ifndef __test__
#define __test__
class Test
{
public:
void test();
static void testStatic();
};
#endif...
分类:
编程语言 时间:
2014-07-10 21:46:37
阅读次数:
353
题目链接:点击打开链接
需要注意的是镜子在与2个人共线时是不作为障碍物,但其他情况与墙一致
#include
#include
#include
#include
#include
using namespace std;
#define point Point
const double eps = 1e-8;
const double PI = acos(-1.0);
double ABS(...
分类:
其他好文 时间:
2014-07-10 21:32:50
阅读次数:
254
模板实现头文件:#ifndef SUN_LINKLIST_H#define SUN_LINKLIST_H#include using namespace std ;//#include "List.h"// T : operator= , operator!= , operator== , cop....
分类:
编程语言 时间:
2014-07-10 16:23:14
阅读次数:
220
题目描写叙述给你一个有N个数的集合S和一个数X,推断是否存在S的一个子集,子集里的数的最小公倍数正好是X。输入第一行是数据组数T。 接下来有多组数据,每组数据包括两行: 第一行有2个数N和X,1#include #include using namespace std;#define ll __in...
分类:
其他好文 时间:
2014-07-10 15:29:01
阅读次数:
176