问题:删除距离末尾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
发现好多半平面交用N^2的增量法都能过诶。。。#include #include #include #include #include using namespace std;const int MAXN=1550;const double eps=1e-8;struct point { doubl...
分类:
其他好文 时间:
2014-08-06 17:52:11
阅读次数:
261
以下摘自linux下的man文件:(man getitimer) #include int getitimer(int which, struct itimerval * curr_value); int setitimer(int which, const struct itimerval...
分类:
系统相关 时间:
2014-08-06 14:45:41
阅读次数:
370
#include #include int main() { struct tm tm; char buf[255]; strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm); strftime(buf, sizeof(buf), "%.....
分类:
其他好文 时间:
2014-08-06 14:44:11
阅读次数:
372
Your intuition would tell you that there's a O(n) solution. Actually it is another stack-based problem to solve.class Solution {public: struct Rec ...
分类:
其他好文 时间:
2014-08-06 14:37:41
阅读次数:
186
1、值类型表示实际的数据,存储在堆栈中。值类型包括(简单类型【整数类型、布尔类型、字符类型、实数类型】、枚举类型【关键字enum声明】、结构类型【单一实体的类型就叫做实体类型。关键字struct声明,可以带构造函数】)2、引用类型表示指向数据的指针或引用,可存储对实际数据的引用。引用类型包括(类、接...
分类:
其他好文 时间:
2014-08-06 14:22:21
阅读次数:
175
定义的枚举 public enum BudgetShopType : int { /// /// 装修费预算 /// [EnumMember(Value = "装修费预算")] BudgetDS = 1, ...
分类:
其他好文 时间:
2014-08-06 14:11:01
阅读次数:
217
线段树 1 #include 2 using namespace std; 3 4 const int maxn = 1000005; 5 const int INF = 1000000009; 6 7 struct node { 8 int sum,ma,mi; 9...
分类:
其他好文 时间:
2014-08-06 14:09:11
阅读次数:
374