c语言 ACM或者趣味题目

来源:百度知道 编辑:UC知道 时间:2024/05/19 12:53:45
谁为我提供一下
c语言方面的
ACM 或者 趣味题目
(谢绝简单题目)
要解释一下算法 谢谢 :)
不满意 :(

你要这些题目的目的是什么,不就是为了锻炼自己的编程水平么,那还要别人解释算法干什么,这对你能起到锻炼作用么.

这算胡言乱语?做ACM之类的题目,不就是要你自己独立思考么,在失败N次后你可以向别人求助算法,思路,但不能一开始就要知道算法,那样做ACM还有意义么.

我建议你还是系统的去学学算法吧
回溯算法
动态规划
贪心算法
等等

推荐书籍 《算法导论》

给你个题目链接,我做ACM的第一题,对我来说很简单的
不知道你怎么样
http://acm.pku.edu.cn/JudgeOnline/problem?id=3028

Description

This is back in the Wild West where everybody is fighting everybody. In particular, there are n cowboys, each with a revolver. These are rather civilized cowboys, so they have decided to take turns firing their guns until only one is left standing. Each of them has a given probability of hitting his target, and they all know each other’s probability. Furthermore, they are geniuses and always know which person to aim at in order to maximize their winning chance, so they are indeed peculiar cowboys. If there are several equally