这题,加了精度错了,不加精度反而对了。。。#include #include #include #include #include using namespace std;const int MAXN=110;const double eps=1e-8; struct point { doub...
分类:
其他好文 时间:
2014-08-07 12:52:49
阅读次数:
184
List类中不带参数的Sort函数可以用来为List类中的元素排序,但如果List类中的元素类型本身不能直接进行比较(如自定义的struct和很多class),或是希望采用更加灵活的自定义比较方式,可以通过继承了IComparer接口...
分类:
其他好文 时间:
2014-08-07 00:55:07
阅读次数:
226
邻接矩阵 网上很少有C# 写图的数据结构的例子,实际的项目中也从来没用过Array 这坨东西,随手写个,勿喷。namespace LH.GraphConsole{ public struct Graph { public Graph(int vertexNumber, in...
分类:
其他好文 时间:
2014-08-07 00:28:47
阅读次数:
234
#include
main()
{
struct cmplx{int x;int y;}
cnum[2]={1,3,2,7};
printf("%d\n",cnum[0].y/cnum[0].x*cnum[1].x);
}...
分类:
其他好文 时间:
2014-08-06 23:13:52
阅读次数:
262
POINTSstruct为可以包含数据和函数的值类型struct为值类型所以不需要堆(heap)而是在栈(stack)上分配空间struct将数据直接存在struct中,而class只存引用类型的指针struct适用于小的数据结构struct会影响性能struct可以使用new操作可以调用构造器,但...
分类:
其他好文 时间:
2014-08-06 22:32:02
阅读次数:
262
问题:输出二叉树的每一行的结点,从叶子到根/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(i...
分类:
其他好文 时间:
2014-08-06 22:04:02
阅读次数:
185
问题:根节点到叶子结点的所有权值和分析:从根节点遍历,若遍历到叶子结点,则sum+其路径的所有权值和/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * Tree...
分类:
其他好文 时间:
2014-08-06 21:59:32
阅读次数:
184
问题:删除距离末尾n个距离的结点分析:先找出距离末尾n个距离的结点其距离开始的距离多少,然后再删除/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ...
分类:
其他好文 时间:
2014-08-06 21:58:02
阅读次数:
199
今天是第二部分:玩家和AI
玩家主要是实现悔棋的功能
AI主要是搜索、最大最小算法,枝剪算法
1、每一步落子的步骤,为了可以悔棋
typedef struct ReversiStep
{
ReversiBitBoard m_LastMap;
ReversiStep& operator= (const ReversiStep& temp)
{
...
半平面交模板#include #include #include #include #include using namespace std;const int MAXN=110;const double eps=1e-8;struct point { double x,y;};point pts[...
分类:
其他好文 时间:
2014-08-06 18:14:31
阅读次数:
240