上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页

1088 Rational Arithmetic (20 分)

摘要: 1088 Rational Arithmetic (20 分) For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference 阅读全文
posted @ 2019-02-02 14:05 ZhangのBlog 阅读(151) 评论(0) 推荐(0) 编辑

1081 Rational Sum (20 分)分数加法

摘要: 1081 Rational Sum (20 分) Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Eac 阅读全文
posted @ 2019-02-02 12:49 ZhangのBlog 阅读(410) 评论(0) 推荐(0) 编辑

最大公约数与最小公倍数

摘要: #include #include #include #include #include #include #include #include #include #include #include using namespace std;//不需要考虑两个数的大小关系 int gcd(int a,int b) { if(b==0) return a; return... 阅读全文
posted @ 2019-02-02 12:01 ZhangのBlog 阅读(224) 评论(0) 推荐(0) 编辑

1104 Sum of Number Segments (20 分)有超时

摘要: 1104 Sum of Number Segments (20 分) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the 阅读全文
posted @ 2019-02-01 19:20 ZhangのBlog 阅读(142) 评论(0) 推荐(0) 编辑

1007 素数对猜想 (20 分)

摘要: 1007 素数对猜想 (20 分) 让我们定义d​n​​为:d​n​​=p​n+1​​−p​n​​,其中p​i​​是第i个素数。显然有d​1​​=1,且对于n>1有d​n​​是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。 现给定任意正整数N(<10​5​​),请计算不超过N的满足猜想 阅读全文
posted @ 2019-02-01 18:34 ZhangのBlog 阅读(144) 评论(0) 推荐(0) 编辑

1013 数素数 (20 分)

摘要: 1013 数素数 (20 分) 令 P​i​​ 表示第 i 个素数。现任给两个正整数 M≤N≤10​4​​,请输出 P​M​​ 到 P​N​​ 的所有素数。 输入格式: 输入在一行中给出 M 和 N,其间以空格分隔。 输出格式: 输出从 P​M​​ 到 P​N​​ 的所有素数,每 10 个数字占 1 阅读全文
posted @ 2019-02-01 18:17 ZhangのBlog 阅读(623) 评论(0) 推荐(0) 编辑

1059 Prime Factors (25 分)素数 “筛选法”

摘要: 1059 Prime Factors (25 分) Given any positive integer NNN, you are supposed to find all of its prime factors, and write them in the format NNN = p1k1×p 阅读全文
posted @ 2019-02-01 16:51 ZhangのBlog 阅读(286) 评论(0) 推荐(0) 编辑

1039 Course List for Student (25 分)map and set

摘要: 1039 Course List for Student (25 分) Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the cour 阅读全文
posted @ 2019-02-01 15:19 ZhangのBlog 阅读(304) 评论(0) 推荐(0) 编辑

1055 The World's Richest (25 分)

摘要: 1055 The World's Richest (25 分) Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest pe 阅读全文
posted @ 2019-01-31 21:51 ZhangのBlog 阅读(576) 评论(0) 推荐(0) 编辑

1048 Find Coins (25 分)散列

摘要: 1048 Find Coins (25 分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal 阅读全文
posted @ 2019-01-31 20:17 ZhangのBlog 阅读(154) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页