文章分类 -  模拟题

摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAXSIZE 1005int x[MAXSIZE], y[MAXSIZE], z[MAXSIZE];inline void swap(int &a, int &b){ int t = a; a = b; b = t;}... 阅读全文
posted @ 2010-11-14 23:51 菜到不得鸟 阅读(145) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <map>using namespace std;map<int, int> numMap;map<int, int>::iterator mIt;int middle4ToInt(const ch... 阅读全文
posted @ 2010-11-14 20:23 菜到不得鸟 阅读(107) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#define MAXN 15#define MAXM 15//const int dir[4][2] = { {0, 1}, {1, 0}, {0, -1}, {-1, 0} }; //east, so... 阅读全文
posted @ 2010-11-14 19:12 菜到不得鸟 阅读(119) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>class PDCls{public: void init() { x = y = z = 0; forward = 0; right = 1; up = 2; backward = 3; left = 4; down = 5; } void pom(... 阅读全文
posted @ 2010-11-14 18:14 菜到不得鸟 阅读(177) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAXCMDLEN 10#define MAXURLLEN 75#define MAXSTKSIZE 105char cmd[MAXCMDLEN];char inURL[MAXURLLEN];char *curURL;char stkB... 阅读全文
posted @ 2010-11-14 16:06 菜到不得鸟 阅读(155) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAXN 105#define MAXH 30struct RNode{ int x, y;};RNode rec;int N, M;char frame[MAXN][MAXN];bool visited[MAXH];bool ans[... 阅读全文
posted @ 2010-11-14 11:23 菜到不得鸟 阅读(192) 评论(0) 推荐(0)
摘要:import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner cin = new S... 阅读全文
posted @ 2010-10-16 12:18 菜到不得鸟 阅读(171) 评论(0) 推荐(0)
摘要:#include <stdio.h>#define MAXR 100#define MAXC 10int a[MAXR][MAXC];int main(){ int T,cas,n,i,j,max; scanf("%d",&T); for(cas=1;cas<=T;cas++) { scanf("%d",&n); max = 0; for(i=1; i<=n... 阅读全文
posted @ 2010-09-03 23:58 菜到不得鸟 阅读(136) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAXN 12const int dir[8][2]={ {-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1} };char grid[MAXN][MAXN],player[MAXN... 阅读全文
posted @ 2010-08-28 23:05 菜到不得鸟 阅读(145) 评论(0) 推荐(0)
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3383#include <stdio.h>#define MAXN 302int w,h,red,green,blue,bitmap[MAXN][MAXN];int threshold,grayscale,sum_of_grayscale,average_gray... 阅读全文
posted @ 2010-08-22 21:44 菜到不得鸟 阅读(221) 评论(0) 推荐(0)
摘要:这题是1563 find your present的数据加强版,代码完全一样异或的性质:1.x^0=x2.x异或y偶数次=x代码(218MS):#include <stdio.h>int main(){ int n,a,ans; while(scanf("%d",&n),n) { ans=0; while(n--) { scanf("%d",&a); ans^=a; }... 阅读全文
posted @ 2010-08-18 23:41 菜到不得鸟 阅读(159) 评论(0) 推荐(0)