上一页 1 2 3 4 5 6 ··· 10 下一页

2015年10月6日

usaco Milk Measuring

摘要: 迭代加深搜索。一开始写了个完全背包,但只能过几个测试点,发现它有些情况不能很好的判断。好在迭代加深并不难写。/*ID: modengd1PROG: milk4LANG: C++*/#include #include #include #include #include using namespace... 阅读全文

posted @ 2015-10-06 16:17 insaneman 阅读(164) 评论(0) 推荐(0)

usaco Snail Trails

摘要: N没有给数据范围是这题最恶心的地方,因为这个wa了有点恶心。/*ID: modengd1PROG: snailLANG: C++*/#include #include #include using namespace std;char Map[200][200];bool vis[200][200]... 阅读全文

posted @ 2015-10-06 01:11 insaneman 阅读(145) 评论(0) 推荐(0)

2015年10月5日

usaco Musical Themes

摘要: /*ID: modengd1PROG: themeLANG: C++*/#include #include #include using namespace std;int input[5000];int main(){ freopen("theme.in","r",stdin); fr... 阅读全文

posted @ 2015-10-05 20:07 insaneman 阅读(165) 评论(0) 推荐(0)

usaco Starry Night

摘要: 就是最简单能想到的那种拿到两个形状然后匹配。 但是有好多好多/*ID: modengd1PROG: starryLANG: C++*/#include #include #include #include using namespace std;struct pic{ pair LU; ... 阅读全文

posted @ 2015-10-05 19:21 insaneman 阅读(238) 评论(0) 推荐(0)

2015年10月2日

usaco Shuttle Puzzle

摘要: 有个2*N+1的线性的棋盘,开始时最左边全是白,右边全是黑,中间一个空格。目标是黑白全部互换。求输出最少步数的操作的棋子的下标。并且要字典序最小的。980ms险过。不判重700ms能过。我居然多此一举的用map判重。/*ID: modengd1PROG: shuttleLANG: C++*/#inc... 阅读全文

posted @ 2015-10-02 22:22 insaneman 阅读(215) 评论(0) 推荐(0)

usaco Letter Game

摘要: 先计算出每个单词的值,如果单词不合法则为-1,同时找出最大的单词。然后输出。/*ID: modengd1PROG: lgameLANG: C++*/#include #include #include #include #include #include using namespace std;in... 阅读全文

posted @ 2015-10-02 21:15 insaneman 阅读(246) 评论(0) 推荐(0)

usaco Street Race

摘要: 图一表示一次街道赛跑的跑道。可以看出有一些路口(用 0 到 N 的整数标号),和连接这些路口的箭头。路口 0 是跑道的起点,路口 N 是跑道的终点。箭头表示单行道。运动员们可以顺着街道从一个路口移动到另一个路口(只能按照箭头所指的方向)。当运动员处于路口位置时,他可以选择任意一条由这个路口引出的街道... 阅读全文

posted @ 2015-10-02 18:21 insaneman 阅读(267) 评论(0) 推荐(0)

2015年10月1日

usaco Buy Low, Buy Lower

摘要: 这题有两问,第一问就是最长下降子序列。对于第二问求最长下降序列的数量,可以通过求第一问的过程解决。设MaxCnt[i]为第i项为末尾中最长下降序列的个数。对于所有的j(1≤j≤i-1)如果有(s[j]>s[i] 并且 MaxLength[j]+1>MaxLength[i])则MaxCnt[i]=Ma... 阅读全文

posted @ 2015-10-01 21:59 insaneman 阅读(252) 评论(0) 推荐(0)

usaco Job Processing

摘要: A型机器从输入库接受工件,对其施加操作A,得到的中间产品存放在缓冲库。B型机器从缓冲库接受中间产品,对其施加操作B,得到的最终产品存放在输出库。所有的机器平行并且独立地工作,每个库的容量没有限制。每台机器的工作效率可能不同,一台机器完成一次操作需要一定的时间。给出每台机器完成一次操作的时间,计算完成... 阅读全文

posted @ 2015-10-01 13:50 insaneman 阅读(289) 评论(0) 推荐(0)

2015年9月30日

The Perfect Stall

摘要: 农夫有N头牛,M个牛栏,每个牛只在自己喜欢的几个牛栏中的一个里挤奶,求最多能同时有几个牛同时挤奶。赤裸裸的二分匹配。用dinic算法解的/*ID: modengd1PROG: stall4LANG: C++*/#include #include #include #include #include ... 阅读全文

posted @ 2015-09-30 23:35 insaneman 阅读(324) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 10 下一页

导航