Problem 2884 --2.1.2 Ordered Fractions

2884: 2.1.2 Ordered Fractions

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $3$ 正确数量 $2$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco 排序 结构体

Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N.

Here is the set when N = 5:

0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1/1

Write a program that, given an integer N between 1 and 160 inclusive, prints the fractions in order of increasing magnitude. 

PROGRAM NAME: frac1

One line with a single integer N. 
One fraction per line, sorted in order of magnitude. 
5
0/1
1/5
1/4
1/3
2/5
1/2
3/5
2/3
3/4
4/5
1/1

推荐代码 查看2884 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$3 $ms] 计爱玲 446431 2019-07-04 07:40:13
内存最少[$1704 $KB] AOJ大管家 445497 2019-06-22 21:23:47
第一AC AOJ大管家 445497 2019-06-22 21:23:47
第一挑战 AOJ大管家 445496 2019-06-22 21:23:31

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛