随笔分类 -  贪心

摘要:Problem Description Doctor Ghee is teaching Kia how to calculate the sum of two integers. But Kia is so careless and alway forget to carry a number when the sum of two digits exceeds 9. For example, w... 阅读全文
posted @ 2013-09-12 19:32 1002liu 阅读(293) 评论(0) 推荐(0)
摘要:59 3 2 5 97 4 7 5 46 9 3 9 35 2 8 7 29 9 4 1 90 阅读全文
posted @ 2013-09-09 21:43 1002liu 阅读(292) 评论(0) 推荐(0)
摘要:In Zhejiang University, there are N different courses labeled from 1 to N. Each course has its own time slot during the week. We can represent the tim 阅读全文
posted @ 2013-08-05 23:29 1002liu 阅读(273) 评论(0) 推荐(0)
摘要:Problem Description 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西更长的字符串,也由小写字母组成,如果能通过魔法转换使小明的串和小西的变成同一个,那么他们两个人都会很开心。这里魔法指的是小明的串可以任意删掉某个字符,或者把某些字符对照字符变化表变化。如: 小西的串是 abba; 小明的串是 addba; ... 阅读全文
posted @ 2013-06-16 21:50 1002liu 阅读(184) 评论(0) 推荐(0)
摘要:There are N little kids sitting in a circle, each of them are carrying some java beans in their hand. Their teacher want to select M kids who seated i 阅读全文
posted @ 2013-05-19 00:13 1002liu 阅读(314) 评论(0) 推荐(0)