hihocoder-1186-求约数
来源:互联网 发布:pcb仿真软件 编辑:程序博客网 时间:2024/06/05 23:47
1.题目
#1186 : Coordinates
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
- 样例输入
6 2
- 样例输出
1 11 22 12 23 13 26 16 2
描述
Give you two integers P and Q. Let all divisors of P be X-coordinates. Let all divisors of Q be Y-coordinates.
For example, when P=6 and Q=2, we can get the coordinates (1,1) (1,2) (2,1) (2,2) (3,1) (3,2) (6,1) (6,2).
You should print all possible coordinates in the order which is first sorted by X-coordinate when coincides, sorted by Y-coordinate.
输入
One line with two integers P and Q(1 <= P, Q <= 10000).
输出
The output may contains several lines , each line with two integers Xi and Yi, denoting the coordinates.
2.分析
水题,求出P的约数列表pList,求Q的约数列表qList,两两搭配即可。
注意约数列表从小到大排列,不能重复。
3.代码
0 0
- hihocoder-1186-求约数
- 求约数个数问题
- 求最大约数
- 求约数的个数
- 求约数的个数
- 求约数的个数
- 求约数个数最多问题
- 求一个数的约数
- 高效率求约数的个数
- 【HUSTOJ】1034: 求约数个数
- 【HUSTOJ】1035: 求约数之和
- 求一个数的约数
- 【小算法】求约数个数
- hihoCoder 1186 : Coordinates(快速求因子【思维】)
- 求N的阶乘约数的个数
- 工大OJ 1014 求约数个数
- 求一个数的约数个数!
- SOJ-1748(求约数个数)
- oracle定义job执行存储过程方式
- [Java基础] HashCode、equals、==的区别
- C++字符串学习(二)
- Pro Git中文版——Git 基础
- 设计模式之迭代器模式
- hihocoder-1186-求约数
- C++关键字之:explicit
- Android新手入门2016(2)--Mac下的Android开发环境
- 工作中遇到的遇到的问题总结20160307
- 博弈问题之Nim游戏
- centos7 下安装scrapy
- LeetCode 96. Unique Binary Search Trees
- 《青年在选择职业时的考虑》——马克思
- Hadoop集群安装与配置