代码改变世界

阅读排行榜

Implement a firewall

2010-10-01 23:28 by wansishuang, 206 阅读, 收藏,
摘要: Implement a firewallprototype:bool firewall(string url, list<string> IncludedList, List<string> ExcludedList)Return true if the url is in included listReturn false if the url is in exclude... 阅读全文

sum of piece

2010-10-20 10:34 by wansishuang, 195 阅读, 收藏,
摘要: 一个数组,N个正整数,分成x段,找一种分段法,minimize the maximum sum of x pieces,0 < sum of piece < sum all, 在这个区间进行二分http://poj.org/problem?id=3273http://poj.org/bbs?problem_id=3273 阅读全文

rectangles overlap

2010-10-03 23:03 by wansishuang, 187 阅读, 收藏,
摘要: rectangles are given. As a struct having {bottomleft-x, bottomleft-y, topright-x, topright-y} you are given two rectangles R1, R2? determine if they intersect 阅读全文

筛选法求素数

2010-09-26 19:28 by wansishuang, 175 阅读, 收藏,
摘要: #include #include #include #include #include //#include int main() { int num; printf("Find primes up to: "); scanf("%d", &num); clock_t start, stop; assert((start = clock... 阅读全文

Remove extra brackets

2010-09-25 16:43 by wansishuang, 169 阅读, 收藏,
摘要: I have a expression containing extra brackets .Write an algo which can remove unwanted brackets like expression is (((a+d)*(a-2))) so we shuld be able to get (a+d)*(a-2)One solution:Think it will be ... 阅读全文