上一页 1 ··· 4 5 6 7 8 9 10 下一页

2015年8月27日

usaco Barn Repair

摘要: 农夫需要将一串大小相等的畜棚盖起来,但是他只能定做M个木板,并不是所有的畜棚都有牛,所以不需要将所有的畜棚都盖起来。问在将所有有牛畜棚都盖起来且只能定做M个木板的情况下,使用的M个木板最少能盖多少个畜棚。贪心的找出M-1个最大(相连且没有牛的畜棚区间),这些区间总和就是不许要盖住的总和,然后用编号最... 阅读全文

posted @ 2015-08-27 11:04 insaneman 阅读(157) 评论(0) 推荐(0)

usaco Mixing Milk

摘要: 发现我真的是很喜欢使用优先度咧一个牛奶包装商人,从不同的奶农手里收购牛奶,以最低的价格买够每日所需,问最少花多少钱。直接贪心,/*ID: modengd1PROG: milkLANG: C++*/#include #include #include struct node{ int P; ... 阅读全文

posted @ 2015-08-27 00:02 insaneman 阅读(202) 评论(0) 推荐(0)

2015年8月26日

usaco Dual Palindromes

摘要: /*ID: modengd1PROG: dualpalLANG: C++*/#include #include #include #include using namespace std;char leter[20]={'0','1','2','3','4','5','6','7','8','9',... 阅读全文

posted @ 2015-08-26 22:50 insaneman 阅读(127) 评论(0) 推荐(0)

usaco Palindromic Squares

摘要: 我会告诉你进制转换我都忘了,翻出了数字逻辑课本才想起来的。/*ID: modengd1PROG: palsquareLANG: C++*/#include #include #include #include using namespace std;char leter[20]={'0','1','... 阅读全文

posted @ 2015-08-26 21:28 insaneman 阅读(124) 评论(0) 推荐(0)

usaco Name That Number

摘要: 为什么要使用如此反人类的输入方式。/*ID: modengd1PROG: namenumLANG: C++*/#include #include #include int main() { FILE *in = fopen ("namenum.in", "r"); FILE *in2 =... 阅读全文

posted @ 2015-08-26 20:22 insaneman 阅读(168) 评论(0) 推荐(0)

usaco Transformations

摘要: /*ID: modengd1PROG: transformLANG: C++*/#include #include using namespace std;char input1[10][10],input2[10][10];char temp[10][10];int N;bool isSame(c... 阅读全文

posted @ 2015-08-26 16:54 insaneman 阅读(166) 评论(0) 推荐(0)

usaco Milking Cows

摘要: /*ID: modengd1PROG: milk2LANG: C++*/#include #include #include struct node{ int time; int O; node(int t,int o) { time=t; O=o... 阅读全文

posted @ 2015-08-26 16:04 insaneman 阅读(121) 评论(0) 推荐(0)

usaco Broken Necklace(dp)

摘要: /*ID: modengd1PROG: beadsLANG: C++*/#include #include #include using namespace std;int N;char input[355];int dp1[355],dp2[355];//dp1是以i为右端点的最长颜色相同的珠宝个... 阅读全文

posted @ 2015-08-26 15:18 insaneman 阅读(144) 评论(0) 推荐(0)

usaco Friday the Thirteenth

摘要: /*ID: modengd1PROG: fridayLANG: C++*/#include #include #include using namespace std;int days[12]={31,29,31,30,31,30,31,31,30,31,30,31};int N;int count... 阅读全文

posted @ 2015-08-26 00:25 insaneman 阅读(140) 评论(0) 推荐(0)

2015年8月25日

usaco Greedy Gift Givers

摘要: /*ID: modengd1PROG: gift1LANG: C++*/#include #include#includeusing namespace std;char names[30][20];int acount[30];int counter,N;int getIndex(char nam... 阅读全文

posted @ 2015-08-25 23:00 insaneman 阅读(148) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 下一页

导航