摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2102复习了一遍队列,借鉴了网上的一些不错的方法,学习了!View Code #include<iostream>#include<cstdio>#include<queue>#define M 11using namespace std;char map[2][M][M];int set[2][M][M];int Dir[4][2]={{1 , 0},{0 , 1},{-1 , 0},{0 , -1}};int n,m,t;int mx,my,mz;int i,j,k;s 阅读全文
posted @ 2011-04-25 19:52
聊聊IT那些事
阅读(565)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=2100一个26进制的大数加法,View Code #include<iostream>#include<cmath>#define M 201using namespace std;char ch1[M],ch2[M];int a[M] ,b[M] ;int c[M];int i,j,k;int main(){ while(cin>>ch1>>ch2) { int L1=strlen(ch1); int L2=strlen(ch2); int flag=0; / 阅读全文
posted @ 2011-04-25 17:58
聊聊IT那些事
阅读(428)
评论(0)
推荐(0)
摘要:
末尾的0可以直接输出,j精度问题减小了不少,这样相对效率高些! 不错的方法啊!View Code #include"stdio.h"#include"math.h"int _Max(int x, int y){ return x>y?x:y;}int main(){ int t; int n,m,i; int a[31]; int sum; int mark,x; scanf("%d",&t); while(t--) { scanf("%d %d",&n,&m); for(i=1;i& 阅读全文
posted @ 2011-04-25 15:19
聊聊IT那些事
阅读(347)
评论(0)
推荐(0)