摘要: 接了家里的电话有一种说不出的心酸,工作三年多了装修个房子还需要家里支持那么多,本身也不是富裕人家,想想有点心酸想想未来无比惆怅。。。我会好起来,我会有钱的 阅读全文
posted @ 2013-11-28 18:20 天晴会下雨 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 struct listNode{ 5 char data; 6 struct listNode *nextPtr; 7 }; 8 typedef struct listNode LISTNODE; 9 typedef LISTNODE *LISTNODEPTR; 10 11 void insertList(LISTNODEPTR *,char); 12 char deleteList(LISTNODEPTR *,char); 13 int isEmpty... 阅读全文
posted @ 2013-04-13 20:52 天晴会下雨 阅读(251) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>/* Copyright Derek Kisman (ACM ICPC ECNA 1999) */char map[26] = {'2', '2', '2', '3', '3', '3', '4', '4', '4', '5', '5', '5', ' 阅读全文
posted @ 2013-04-09 16:40 天晴会下雨 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 时间复杂度为N方 1 #include <iostream> 2 3 using namespace std; 4 //最长子序列 5 6 int MaxSequence(int a[],int N) 7 { 8 int thisSum,maxSum=0,i,j; 9 for(i=0;i<N;i++)10 {11 thisSum=0;12 for(j=i;j<N;j++)13 {14 thisSum+=a[j];15 if(thisSum>maxSum)16 ... 阅读全文
posted @ 2013-04-07 19:55 天晴会下雨 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <windows.h> 4 #include <time.h> 5 #include <string.h> 6 #define M 4 7 #define B 2 8 #define S 2 9 typedef char keytype; 10 11 12 /*=================机票结构体=============*/ 13 typedef struct Ticket 14 { 15 char m_number[ 阅读全文
posted @ 2013-04-05 19:34 天晴会下雨 阅读(275) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std; bool isPrimeNumber(int a){ int i; for(i=2;i*i<=a;i++) { if(a%i==0) { //flag=0; return false; } } return true;};bool judge_prime(int digit){ int i,flag; if(digit%2==0) return false; ... 阅读全文
posted @ 2013-04-05 11:56 天晴会下雨 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路径算法(dijkstra,bellman-ford,floyd,heap+dijkstra) (poj1860,poj3259,poj1062,poj2253,poj1125,poj2240) (3)最小生成树算法(prim,krus 阅读全文
posted @ 2013-04-05 10:41 天晴会下雨 阅读(370) 评论(0) 推荐(0) 编辑
摘要: //Memory Time//232K 0MS#include<iostream>#include<algorithm>#include<cstring>using namespace std;int main(void){ int room[401]; int test,move_time,i,j,temp; int from[200],to[200]; cin>>test; for(j=0;j<test;j++) { memset(room,0,sizeof(room)); //注意每次测试都要初始化,而不是在输入测试次数前初始化 .. 阅读全文
posted @ 2013-04-05 10:37 天晴会下雨 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>int main(){ //printf("Hello world!\n"); int n; scanf("%d",&n); int pant[100][100]={0}; int i,j; while(n!=0) { char str[5]; int x,y,l; scanf("%s%d%d%d",&str,&x,&y,&l); if(str[0]=='B') { //scanf( 阅读全文
posted @ 2013-04-04 14:32 天晴会下雨 阅读(183) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>int main(){ //printf("Hello world!\n"); int n; scanf("%d",&n); while(n!=0) { int x,y,z; scanf("%d%d%d",&x,&y,&z); if(x>(y-z)) printf("do not advertise\n"); else if(x==(y-z)) printf("does 阅读全文
posted @ 2013-04-04 13:09 天晴会下雨 阅读(120) 评论(0) 推荐(0) 编辑