摘要: 转载请注明:http://www.cnblogs.com/dingxiaoxian/谢谢~第一题:(水题,物理)题意&解题思路:给你个字符串,'^'表示支点,=表示竿子,'0'-'9'表示该位置挂着一个重量为对应数字的重物,问你天平是向左、向右、还是平衡?第一次循环,找到支点并把每个位置物品重量求出;第二次循环,求出每个点贡献的力矩;最后比较左右边力矩和的大小得到答案。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #defi 阅读全文
posted @ 2013-12-25 03:17 丁小贤 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 转载请注明:http://www.cnblogs.com/dingxiaoxian/谢谢~第一题:(水题)Problem StatementIt's winter time! Time to eat a lot of mandarins with your friends.You have several bags with mandarins. Youare given an vector bags. For each i, the i-th element of bagsrepresents the number of mandarins in the i-th bag. You 阅读全文
posted @ 2013-12-23 05:33 丁小贤 阅读(354) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1330 题目 1: #include 2: #include 3: #include 4: #include 5: using namespace std; 6: 7: int n; 8: int fa[11111],ancestor[11111];... 阅读全文
posted @ 2013-11-29 05:41 丁小贤 阅读(198) 评论(0) 推荐(0) 编辑