Codeforces Round #665 (Div. 2) C. Mere Array

该博客讨论了Codeforces的一道算法题,题目要求在满足条件的交换操作下,判断能否将数组非递减排序。题目描述、输入输出格式、样例及解决方案均被详细阐述,包括直接模拟的解题思路和AC代码。
摘要由CSDN通过智能技术生成

Title

CodeForces 1401 C. Mere Array

Time Limit

2 seconds

Memory Limit

256 megabytes

Problem Description

You are given an array a 1 , a 2 , … , a n a_1, a_2, \dots, a_n a1,a2,,an where all a i a_i ai are integers and greater than 0 0 0.

In one operation, you can choose two different indices i i i and j j j ( 1 ≤ i , j ≤ n 1 \le i, j \le n 1i,jn). If g c d ( a i , a j ) gcd(a_i, a_j) gcd(ai,aj) is equal to the minimum element of the whole array a a a, you can swap

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值