摘要: 1 #include<iostream> 2 using namespace std; 3 const int maxn=30; 4 int n,px,py; 5 int a[maxn][maxn],f[maxn][maxn]; 6 7 void get_prepare() 8 { 9 cin >> n;10 for (int i=0;i<n;i++)11 for (int j=0;j<=i;j++){12 cin >> a[i][j];13 f[i][j]=a[i][j];14 }15 ... 阅读全文
posted @ 2012-07-04 20:05 NoRush 阅读(965) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 string st; 5 int a[9]={0}; 6 int diag=0; 7 8 void get_prepare() 9 {10 cin >> st;11 a[0]=(int)st[0]-48;12 a[1]=(int)st[2]-48;13 a[2]=(int)st[3]-48;14 a[3]=(int)st[4]-48;15 a[4]=(int)st[6]-48;16 a[5]=(int)st... 阅读全文
posted @ 2012-07-04 19:31 NoRush 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 using namespace std; 3 const int maxn=100; 4 int t,n; 5 int c[maxn]={0},w[maxn]={0},f[maxn]={0}; 6 void get_input() 7 { 8 cin >> t >> n; 9 for (int i=0;i<n;i++) cin >> c[i] >>w[i];10 }11 void pack()12 {13 for (int i=0;i<n;i++){14 for (int j= 阅读全文
posted @ 2012-07-04 18:14 NoRush 阅读(568) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 using namespace std; 3 const int maxn=100,maxm=100; 4 const int dirx[4]={0,0,1,-1}; 5 const int diry[4]={1,-1,0,0}; 6 int n,m,maxx=0; 7 int a[maxn][maxm],dis[maxn][maxm]={0}; 8 9 void get_input()10 {11 cin >> n >> m;12 for (int i=0;i<n;i++){13 for (int j=0 阅读全文
posted @ 2012-07-04 17:41 NoRush 阅读(1079) 评论(0) 推荐(0) 编辑