上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 38 下一页
摘要: http://codeforces.com/problemset/problem/992/B 题意: 给你区间[l,r]和x,y 问你区间中有多少个数对 (a,b) 使得 gcd(a,b)=x lcm(a,b)=y ,如果a,b交换位置就是不同的数对 思路: 根据lcm(最小公倍数) 的定义 y=a 阅读全文
posted @ 2019-10-27 16:00 jiamian22 阅读(324) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem;jsessionid=A0F3392F460475E0058F93E009D6BFC3?id=3026 Description The Borg is an immensely powerful race of enhanced humanoids fr 阅读全文
posted @ 2019-10-26 03:27 jiamian22 阅读(201) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1875 Problem Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然 阅读全文
posted @ 2019-10-25 13:06 jiamian22 阅读(256) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1679 Description Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tre 阅读全文
posted @ 2019-10-25 01:41 jiamian22 阅读(196) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1751 Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public h 阅读全文
posted @ 2019-10-24 17:38 jiamian22 阅读(202) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2349 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. 阅读全文
posted @ 2019-10-24 14:00 jiamian22 阅读(184) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2031 Description You are a member of the space station engineering team, and are assigned a task in the construction process 阅读全文
posted @ 2019-10-23 23:36 jiamian22 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 八皇后问题 2n皇后问题 Description 会下国际象棋的人都很清楚:皇后可以在横、竖、斜线上不限步数地吃掉其他棋子。如何将8个皇后放在棋盘上(有8 * 8个方格),使它们谁也不能被吃掉!这就是著名的八皇后问题。 对于某个满足要求的8皇后的摆放方法,定义一个皇后串a与之对应,即a=b1b2.. 阅读全文
posted @ 2019-10-23 00:25 jiamian22 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 约瑟夫问题: N个人围成一圈,第一个人从1开始报数,报M的将被杀掉,下一个人接着从1开始报。如此反复,最后剩下一个,求最后的胜利者。 思路一: 数组模拟 1 #include <stdio.h> 2 #include <string.h> 3 #include <iostream> 4 #inclu 阅读全文
posted @ 2019-10-22 21:53 jiamian22 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 给定一个正整数N,请判断1/N是否为无限小数,若是输出YES,若不是请输出NO。 思路: 只要被除数n可以转换成2的次幂或者2与5的组合即为有限小数,否则为无线小数 代码如下: 递归写法: 阅读全文
posted @ 2019-10-21 23:25 jiamian22 阅读(828) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 38 下一页