【小组冲刺一:自出题五题】2020-10-21冲刺练习

这篇博客探讨了使用直尺和圆规进行几何构造的问题,如判断能否画出正n边形,并涉及了素数对的特定形式。还讨论了如何确定一个数是否能表示为不同素数的和或两个合数的和,以及求最小的正线性组合。这些问题都基于《初等数论及其应用》中的相关理论。
摘要由CSDN通过智能技术生成

冲刺练习2020-10-21

A : Compass-and-straightedge construction

Description

input an integer n n n

Out put whether you can draw an regular n-polygon by compass-and-straightedge construction.

Compass-and-straightedge construction means you can only use a ruler which have no degree scale and a compass , and a pen of course.

Many cases to be input.

Constraints

3 ≤ n ≤ 1 × 1 0 18 3\le n\le 1\times10^{18} 3n1×1018

Sum Cases < 1 0 5 10^5 105

Sample In

3 4 5 6 7 8 9 10 65537

Sample Out

Y Y Y Y N Y N Y Y

Solution

Answer

(结论裸题)

B : Prime Pairs

Description

output every pair form of p^a-q^b=1

where p and q are primes, and a and b are positive integers , and a,b > 1

Constraints

In order to avoid huge output, there must have :

1 < a , b < 1 0 5 1<a,b<10^5 1<a,b<105

2 ≤ p , q ≤ 1 0 5 2\le p,q\le 10^5 2p,q105

Sample In

None

Sample Out

None

Solution

《初等数论及其应用》P66 , 23题

(签到题)

C : Easy Prime Number Partitions

Description

input an integer n.

Determine whether it could be written in the sum of different primes.

Many cases to be input.

Constraints

2 ≤ n ≤ 1 0 9 2\le n\le 10^9 2n109

Sum Cases < 1 0 5 10^5 105

Sample In

2 4 100 114514

Sample Out

Y N Y Y

Solution

《初等数论及其应用》P67 , 28题

(签到题)

D : Easy Composite Number Partitions

Description

input an integer n.

Determine whether it could be written in the sum of two composite numbers.

Many cases to be input.

Constraints

2 ≤ n ≤ 1 0 9 2\le n\le 10^9 2n109

Sum Cases < 1 0 5 10^5 105

Sample In

2 4 100 114514

Sample Out

N N Y Y

Solution

《初等数论及其应用》P66 , 14题

(签到题)

E : Minimum Positive Linear Combination

Description

each line gives you two positive integer a , b a,b a,b

output the minimum positive k k k ,s.t.

k = m a + n b k=ma+nb k=ma+nb , where m , n m,n m,n is an integer

Constraints

1 ≤ a , b ≤ 1 0 9 1\le a,b\le 10^9 1a,b109

Sum Cases < 1 0 3 10^3 103

Sample In

1 100

9 15

Sample Out

1

3

Solution

《初等数论及其应用》P69 , 定理3.7

(签到题)

F : Half-coprime Array

Description

give you an integer n n n

you need to output an array , which length is n.

and gcd ⁡ ( a 1 , a 2 , ⋯   , a n ) = 1 \gcd(a_1,a_2,\cdots,a_n)=1 gcd(a1,a2,,an)=1

However , if you select n − 1 n-1 n1 elements s.t. b 1 , b 2 , ⋯   , b n − 1 b_1,b_2,\cdots,b_{n-1} b1,b2,,bn1 ∀ i ≠ j ,   b i ≠ b j \forall i\ne j,\,b_i\ne b_j i=j,bi=bj and ∀ i ,   b i ∈ { a 1 , a 2 , ⋯   , a n } \forall i,\,b_i\in\{a_1,a_2,\cdots,a_n\} i,bi{a1,a2,,an}

and gcd ⁡ ( b 1 , b 2 , ⋯   , b n − 1 ) ≠ 1 \gcd(b_1,b_2,\cdots,b_{n-1}) \ne 1 gcd(b1,b2,,bn1)=1

Constraints

3 ≤ n ≤ 15 3\le n\le 15 3n15

1 ≤ a i ≤ 1 0 18 1\le a_i\le 10^{18} 1ai1018

Sample In

4

Sample Out

910 570 714 1155

Solution

《初等数论及其应用》P73 , 练习18

(魔改+数据增强)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值