自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 资源 (10)
  • 收藏
  • 关注

原创 Topcoder SRM 505 Div 2 hard

这题解法非常巧妙。最关键的一点是, 先由题目想到这个:要知道整个矩形的面积,必须知道所有 X[i] /X[j]的值,同时也必须知道X[i] * Y[j]  (0然后就是用UnionFind来做了

2011-09-21 20:37:29 409

原创 布料类

布料模拟 ogre

2010-12-15 18:56:00 541

原创 FastDelegate

一个快速成员函数指针包装类

2010-11-08 22:48:00 1572

原创 老代码, 第二部分

ogre 老代码

2010-11-08 22:46:00 920

原创 Ogre 相关老代码-- 第一部分

<br />// CattonShading.cg<br />void vs_main(<br /> <br /> in float4 pos : POSITION,<br /> in float4 norm : NORMAL,<br /> in float2 uv   : TEXCOORD0,<br /> uniform   float4x4 worldMat,<br /> uniform   float4x4 viewProjMat,<br /> uniform   float4   eyePos,<b

2010-11-08 22:38:00 577

原创 Note the difference!!!

//header for algorithm#include#include#include#includeusing namespace std;//========Correctbool canWin(int a, int b){ if(b/a>1 || b==a) return true; return !canWin(b-a, a);}//=

2010-05-28 10:03:00 379

原创 poj 2411 动态规划

http://acm.pku.edu.cn/JudgeOnline/problem?id=2411 计算一个矩形用1x2小矩形填充的“不同填充法数量” 假设我们要从第一列开始填充, 填充完第一列, 再填充第二列 这样在填充当前列的某个未填充格子的时候,只有两个选择,横放、竖放 由于在填充第一列的时候,可能横放了一些格子,那么在开始第二列填充时,有些格子已经被覆盖了

2010-05-19 12:37:00 653

原创 红黑树的topdown-remove

红黑树的bottomup-insert很容易实现, 而删除就不容易, 今天抄成功了Julienne Walker发在他网站上的算法, 为备忘, 总结一下。 首先, 删除red 节点, 不影响红黑树的有效性。利用这一点,我们寄希望于可以把其他情况都转化成删除红色节点。 其次, 跟在Binary search tree中一样, 删除一个节点K可以转化为         1,先找到这个节点的in

2009-12-18 21:10:00 377

原创 表达式求值

#include #include string> #include using namespace std; const int PLUS = -1,MINUS=-2,MUL=-3,DIV=-4,LPREN=-5,RPREN=-6,EOE=-7; string expr; int pos; int NextToken() { int t=0;

2009-10-26 18:21:00 295

原创 计算 高次幂相对某个模数的余( (a ^ n)mod p, n 很大 )

在做google codejam 2008 round 1A problem C 的 时候, 从别人代码里学到的 假如 要计算 (a ^ n) , n很大, 直接计算的话, 是个 O(n)的方法有 O(log (n))的方法,如下:       把n表示成2进制, n = n0 * 1 + n1 * 2 + n2 * 4 + ... + nk * (2^k)则    a^n =[

2009-09-10 13:27:00 1186 1

原创 google codejam 2009 Qualification Round Problem C code

#include #include #include using namespace std;const string b("welcome to code jam");//const string b("a");const int MAXLEN = 501; const int m = b.length();int n;string a;int cnt[MAXLEN][20];v

2009-09-04 13:21:00 473

原创 google codejam 2008 APAC local onsites , Problem A What are Birds?

题目在这里http://code.google.com/codejam/contest/dashboard?c=32005# 这题先把问题转化一下, 相当于: 在平面上有一个矩形, 现在知道有一些点于这个矩形的关系。 请根据这些信息, 判断能否确定另一些点与这个矩形的关系 代码如下: #include #include #include using

2009-08-28 13:08:00 494

原创 在UltraEditor ogre material 和 vs_3_0语法高亮显示

找到 wordfile.uew在文件尾加入以下内容,然后把你的vs_3_0的程序都用.vs3扩展名,用UE打开就能(部分)高亮显示了( 有些关键词未搜集完整, 先用着吧 )/L15"Vertex Shader 3.0" Line Comment = ; Line Comment Alt = // File Extensions = VSH3 vs3/Delimiters = [] + 

2009-04-23 14:56:00 1834 1

原创 POJ1097 Roads Scholar

#include #include #include #include using namespace std;const int MAXN = 30;const int MAXDIST = 100000000;int distanc[MAXN][MAXN];//从交点a到b的最短距离 int dist[MAXN][MAXN];//从

2009-01-08 12:45:00 1100

原创 zoj 1909 Square

#include #include using namespace std;int  len[20];int  average;int  n;int  occ[20];bool formSquare(int i, int j, int  amount){    if (amount return false;    if (amount ==

2008-10-31 15:50:00 597

原创 zoj 1095 Humble Numbers

#include #include using namespace std;const int factors[] = { 2, 3, 5, 7 };const int m = 2000000000;const int mm[] = { m/2, m/3, m/5, m/7 };const char* st = "st", *nd = "nd", *rd =

2008-10-31 12:41:00 600

原创 ZOJ 1102 Phylogenetic Trees Inherited (My algorithm , Time limit exeeded)

#include #include using namespace std;int n, l;string s[1025];int cnt[1025][26];string result;inline bool input(){    cin>>n>>l;    if ( !n && !l ) return false;    for

2008-10-30 10:09:00 777

原创 zoj 1104

/*** 由于抛物线经过点(0,0), (D, 0),设抛物线方程为 y = -Ax(x-D), 其中(D, 0)为落地点。* 再由参数方程 x = v0*t*cosO               y = -0.5*g*t^2 + v0*t*sin0  消去参数得   y = -[g/(2*v0^2*cos0^2)]*x^2 + tan0 *x  与前面方程比较

2008-09-03 13:36:00 499

原创 zoj 1166 Anagram Checker

/**A seach problem.**/#include  #include  #include  #include  #include  using namespace std;/**dictionary words**/string word[2000];/**Word in phrase**/string swo

2008-08-07 10:23:00 815

原创 zoj1163 The Staircases 解法1 O(n^3)

#include  #include  using namespace std;int main(int argc, char *argv[]){    long long a[501][501], b[501];    memset(a, 0, sizeof(a));    memset(b, 0, sizeof(b));    for (int 

2008-08-06 11:33:00 718 5

原创 zoj1155 triangle war

/**DP 对状态编号, 18条边, 每条边可能实线, 也可能虚线, 有2^18种MaxScore(x) = max {               StepScore(rCode, selectedEdgeNum) > 0            ?  StepScore + MaxScore(rCode)         //选择的边成三角行           

2008-08-01 17:23:00 924

原创 zoj1136 Code

 #include #include #include #include #include using namespace std;struct item{       string s;       int r; //modulo n};int main(int argc, char *argv[]){    int n, m;    int d[10];    while (cin

2008-07-30 13:10:00 699

原创 zoj1136 Multiple

MultipleTime limit: 10 Seconds   Memory limit: 32768K   Total Submit: 2845   Accepted Submit: 764   a program that, given a natural number N between 0 and 4999 (inclusively), and M distinc

2008-07-30 13:07:00 685

原创 zoj1301 Code

 #include #include #include using namespace std;struct status{ int lightBits, room, step; struct status *next;}status[1024][10];struct door{ int r1, r2;

2008-07-25 08:46:00 503

原创 zoj1301 The New Villa

  The New VillaTime limit: 1 Seconds   Memory limit: 32768K   Special JudgeTotal Submit: 1036   Accepted Submit: 331   Mr. Black recently bought a villa in the countryside. Only one thing

2008-07-25 08:35:00 586

原创 zoj 1144 Robbery

#include #include using namespace std;int a[100][100][100];int b[100];int bx[100], by[100];int W, H, T;int main(int argc, char *argv[]){ int n;

2008-07-11 14:07:00 675

原创 zoj 1134

#include #include #include #include using namespace std;struct node{ vector children; int name; int mSoldiers[2]; int getMin(int i);} no

2008-07-10 14:03:00 416

原创 Google code jam 2008 beta B The Price is Wrong

#include #include #include #include #include using namespace std;struct Prod{ char name[30]; int id;}prod[64], temp[64];int ord[64];int pric

2008-07-10 09:32:00 542

原创 Google code jam 2008 beta A Triangle Trilemma

#include #include #define X 0#define Y 1using namespace std;typedef int pointi[2];int AreaSign(pointi a, pointi b, pointi c){ double x1 = b[X]-a[X], x2 = c[X]-a[

2008-07-09 08:51:00 460

原创 zoj 2110 -- 未解决

#include #include #include #include #include using namespace std;int blk[6][6];int sx, sy, dx, dy;int n, m, t;int dist[6][6];bool Search(int x , int

2008-07-07 15:00:00 306

原创 ZOJ 1128

#include #include #include using namespace std;struct Rect{ double up, left, right, bottom; Rect* next; void insert(double u, double l, double r, double b);

2008-07-07 11:00:00 484

原创 zoj1119 SPF

#include #include #include #include using namespace std;struct Edge{ int to; Edge*next; void insert(Edge* e) { e->nex

2008-07-04 11:10:00 756 1

原创 zoj 1711 Sum It Up

#include #include #include using namespace std;struct Num{ int v, q;}num[12];int t, n;int qty[12];int cnt, j;void Test(int p){ if (p =

2008-07-03 13:38:00 456

原创 zoj 1111 Poker Hands

#include #include using namespace std;struct Card{ char type; int value; Card* next;};void Insert(Card* hand, Card* c){ Card* p =

2008-07-01 17:31:00 682

原创 zoj1028 图

2008-06-25 09:32:00 485

原创 zoj 1028 Flip and Shift

/**证明: 首先, 若n为奇数,则必然可以完成任务 将n个球遍号为1,2,...,n 若从1位置开始,进行 n-1次连续的 (flip, shift, shift), 则 除了球1外, 所有球的位置都 减了2, 而球1最后到达原来球n-1的位置。(见图, 可以知道, 相当于交换球1和2的位置)

2008-06-25 09:21:00 1348

原创 ZOJ 1025 Wooden sticks

#include #include using namespace std;struct node{ int len, wt; node* nxt;};node* list=NULL;void Insert(node* lst, int l, int w){

2008-06-24 14:23:00 569

原创 ZOJ 1093 Monkey and banana

#include #include #define MAXN 30#define MAX(a, b) a>b?a:b#define MIN(a, b) a>b?b:ausing namespace std;struct Block{ int w, l, h;}blks[3*MAXN];int n;

2008-06-24 12:54:00 744

原创 ZOJ 1039 尚未解决

#include #include #include #define MAX (1024*512)using namespace std;int BIT[19];int win[MAX];void PrintBit(int a){ int k = 1; for

2008-06-20 11:25:00 462

原创 zoj 1011NTA

//#include #include #define MAXN 15 #define MAXK 10#define MAXL 10using namespace std;int m, n, k;struct mypair{ int a, b; mypair *next;

2008-06-19 15:54:00 1407 1

An Introduction to R

R Intro 英文版 R 语言的入门书籍,非常基础,易懂,入门好帮手

2017-12-01

windows resource kit tools for windows xp

2009-1-07下午 工具包 学习Windows Internal 4th edition 用, 欢迎下载

2009-01-07

Windows resurce kit tools for winxp

Windows resurce kit tools for winxp 学习Windows Internals 4th edition

2009-01-07

Windows debugging package 2

工具包第二个包 第二个分卷 Windows调试工具

2009-01-07

Windows debugging package

Windows debugging package 适用于Windows XP 调试工具

2009-01-07

Microsoft Windows Internals, tools package

Microsoft Windows Internals, Fourth edition 一书中用到的部分工具包

2009-01-07

python入门练习代码

Python入门资源 Python语法练习 xml

2008-11-30

Hull3D.rar

计算点集的 3D凸包, 并用openGL显示的程序 dev-cpp工程

2008-10-14

acm-zju.rar

我自己在zoj上做的题的代码 多多指点, 也希望高人们分享你们的代码

2008-10-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除