- 博客(19)
- 收藏
- 关注
原创 poj 3253 哈夫曼树
#include #include #include #include #include #include #define MAX 20010using namespace std;long long Q[MAX];long long Index;long long Cos
2011-07-27 11:31:38
232
原创 532 3Ddfs- Dungeon Master
#include #include #include #define MAX 35using namespace std;int q[MAX][MAX][MAX];int visit[MAX][MAX][MAX];int sx,sy,sz,ex,ey,ez;int Q[10000
2011-07-25 08:51:53
266
原创 大整数模板
#include #include #include #include #include using namespace std;const int MAXD = 10000, DIG = 9, BASE = 1000000000;//用int型数组存储,每一位存储九位数const unsigned long long BOUND = numeric_limits :: max ()
2011-06-19 20:51:00
335
原创 uva 727 运算符 中缀到后缀的转换
<br />卡了好久好久 一直没敢在动 今天一遍AC <br /> <br />#include <iostream><br />#include <cstdio><br />#include <cstring><br />#include <cctype><br />#include <stack><br />using namespace std;<br />stack<char>operat;<br />int main()<br />{<br /> //freopen("in.
2011-05-31 20:05:00
578
原创 uva 10003
<br />//没想到测试数据这么多 竟因为memset超时 耗费了整整一天时间<br /> <br />#include <string.h><br />#include <stdio.h><br />#define MAX 1010<br />int c[MAX][MAX];<br />int x[MAX]; // ·Ö¸îλÖÃ<br /><br />int search(int cas,int length)<br />{<br /> int i,j,k;<br /> for(i
2011-05-23 17:15:00
350
原创 矩阵连乘
<br />#include <iostream><br />#include <cstring><br />#include <cstdio><br />#define MAX 1000<br />using namespace std;<br />int m[MAX][MAX];<br />int s[MAX][MAX];//fenge qingkuang<br />int count = 0;<br />void MatrixChain(int p[],int n,int m[][MAX],int s
2011-05-18 21:24:00
420
原创 uva 540 team queue
<br />// 别人的代码 <br /> <br /> <br /> <br />#include <iostream><br />#include <cstdlib><br />#include <cstring><br />#include <cstdio><br />#include <string><br />#define MAXN 1000010<br />#define MAXT 10000<br />using namespace std;<br />typedef struct Li
2011-05-03 16:13:00
487
原创 uva 594 One Little, Two Little, Three Little Endians
<br />//开始没理解好题意卡了很长时间<br /> <br /> <br /> <br /> <br />#include <stdio.h><br />#include <string.h><br />#include <stdlib.h><br />void toer(char *s,int n)<br />{<br /> int i;<br /> if(n < 0){s[0] = '1'; n = -n;}<br /> else<br /> s[0] = '0';<
2011-04-26 23:55:00
893
原创 C - Extended Lights Out
<br />// wa一次 PUZZLE #1 中间小了个空格 <br />注意: 眼看到的不一定为真<br /> <br /> #include <stdio.h><br />#include <string.h><br />void change(int x,int ca[][9],int i,int j)<br />{<br /> if(x == 1)<br /> {<br /> ca[i][j] = (ca[i][j]+1)%2;<br />
2011-04-05 15:08:00
624
原创 G //一遍ac
<br />// 现学的约瑟夫问题,用时有点长 , 还不够深入理解<br /> <br />#include <stdio.h><br />int find(int n,int m)<br />{<br /> int a[200];<br /> int i,j,p ;<br /> p = n;<br /> for(i = 1; i < n ;i++)<br /> a[i] = i + 1;<br /> a[n] = 1;<br /> a[n] = a[
2011-04-02 23:55:00
272
原创 五天一小水 D - Gamblers
// wa 了一次 水过 但耗时间太多 开始时没考虑负数的情况 #include #include #include int cmp_int(const void *a,const void *b){ return *(int *)a - *(int *)b;}int main(){ int i,j,k; int num[1010]; int n; while(scanf("%d",&n) && n != 0){ for(i = 0;i
2011-03-31 16:25:00
316
原创 uva-120 stack of flapjacks
//wa 一次 没考虑 1 1 1 1 1 的情况#include #include #include int cmp_int(const void *a,const void *b){ return *(int *)b - *(int *)a;}int Find(int f,int num[],int n){ int i; for(i = n-1;i >=0;i--) if(f == num[i]) return i+1;}void Flip(int num[],int n
2011-03-29 13:41:00
283
原创 uva - 573 the snail
<br />水 但wa一次 将此句 The snail never climbs a negative distance 忽略
2011-03-28 23:16:00
309
原创 uva-10785 The Mad Numerologist wa两次 忘了排序 第二次忘了写cmp_char 函数
<br />//<br /> <br />char vowel[6] = "AUEOI";<br /> char con[22] = "JSBKTCLDMVNWFXGPYHQZR";<br /> <br /> +<br /> <br /> for(i = 0;i < n/2;i++){<br /> printv[countv++] = vowel[a];<br /> printc[countc++] = con[b];<br />
2011-03-28 15:41:00
490
原创 uva-400 Unix is 水 但因看题不仔细 输出错误 wa了一次
<br />#include <stdio.h><br />#include <string.h><br />#include <stdlib.h><br />int cmp_str(const void *a,const void *b)<br />{<br /> return strcmp((char *)a,(char *)b);<br />}<br />int main()<br />{<br /> int n,i,j,k;<br /> char a[110][65];<br />
2011-03-27 21:07:00
341
原创 uva - 10474
<br />#include <stdio.h><br />#include <stdlib.h><br />#include <string.h><br />int intcmp(const void *a,const void *b)<br />{<br /> return (*(int *)a - *(int *)b);<br />}<br />int _Bsearch(int f,int *count,int n) //二分查找下界<br />{<br /> int mid,left =
2011-03-21 22:25:00
452
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人