本文版权归点A点C和博客园共有,欢迎转载,但必须保留此段声明,并给出原文连接,谢谢合作!!!

2012年11月10日

hdu1312 Red and Black(最基础的搜索题)

摘要: 这个题就是找和'@'相连通的'.'的个数再加1。深搜和广搜都可以,只不过貌似广搜更省时间。我的是用广搜写的:View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<queue> 4 using namespace std; 5 char map[21][21]; 6 int h,w,sum; 7 struct node 8 { 9 int x;10 int y;11 };12 struct node start;13 void make_map()14 {15 阅读全文

posted @ 2012-11-10 16:19 点A点C 阅读(182) 评论(0) 推荐(0) 编辑

hdu 1789 Doing Homework again (贪心)

摘要: 思路:把所有的的作业按分值从大到小排序,之后去从最大的那头开始取,在保证完成的情况下尽量靠后安排,如果它截止日期前的每一天都有任务了的话就把这一科的分数加到最后要扣的分中(比如:样例二中排序后应该是6,3,2对应的截止日期分别是1,1,3,所以第1天的时候完成6分的,当到3分的时候因为截至日期是1而且第1天也已经有任务了所以这一科他就无法完成)很久以前做的一个题了!!View Code 1 #include<stdio.h> 2 #include<string.h> 3 #define N 1010 4 int flag[1010]; 5 int main() 6 { 阅读全文

posted @ 2012-11-10 16:12 点A点C 阅读(235) 评论(0) 推荐(0) 编辑

1004 Let the Balloon Rise(水题)

摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 char s[1002][20]; 4 char ss[1002][20]; 5 int k[1002]; 6 int main() 7 { 8 int i,n,j,x,w; 9 while(scanf("%d",&n)!=EOF&&n)10 {11 scanf("%s",s[0]);12 getchar();13 w=0;14 strcpy(ss[0],s[0]);15 k[0]=1... 阅读全文

posted @ 2012-11-10 16:03 点A点C 阅读(155) 评论(0) 推荐(0) 编辑

导航