摘要: 思路:遍历数字中每个元素,当前元素大于右边的元素时将其删去。每当完成一个删除操作时将 从头开始遍历。 阅读全文
posted @ 2019-01-03 13:58 图袋鼠 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean 阅读全文
posted @ 2018-12-20 16:11 图袋鼠 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 畅通工程 Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? <br> Input 阅读全文
posted @ 2018-12-06 16:41 图袋鼠 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Problem Description Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. H 阅读全文
posted @ 2018-10-11 15:05 图袋鼠 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Problem Description Wang Haiyang is a strong and optimistic Chinese youngster. Although born and brought up in the northern inland city Harbin, he has 阅读全文
posted @ 2018-10-11 14:14 图袋鼠 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Least Common Multiple Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divi 阅读全文
posted @ 2018-09-22 16:46 图袋鼠 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 贪心算法~ 阅读全文
posted @ 2018-09-15 10:12 图袋鼠 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 这道题花了挺多时间,主要因为以下问题 一、字符串的输入,这道题里用scanf更为安全 二、每组数据结束后结构体内容应该清空,否则影响下组数据 三、由于我的代码里成绩的读取是从1开始的,所以循环时要注意(因为解题数总为正数) 阅读全文
posted @ 2018-09-13 21:19 图袋鼠 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { while (1) { int count=0; int sum=0; while (1) { char c; int temp = 0; c = getchar(... 阅读全文
posted @ 2018-09-07 23:32 图袋鼠 阅读(83) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { //第一个循环用于输入,遇到#停止 while (1) { //第二个循环用于单次输入的每个字符的判断 while (1) { char c; c = getchar(); ... 阅读全文
posted @ 2018-09-07 23:06 图袋鼠 阅读(99) 评论(0) 推荐(0) 编辑