早教吧作业答案频道 -->英语-->
Wehaveanarrayofpositiveintegers.Wewilltransformthisarraybyrepeatingthefollowingoperationuntiltherearelessthantwoelementsleft:Choosethetwoelementsthathavetheminimalabsolutedifference.Iftherearemultiplesuchpairs,cho
题目详情
We have an array of positive integers.We will transform this array by repeating the following operation until there are less than two elements left:
Choose the two elements that have the minimal absolute difference.If there are multiple such pairs,choose the one among them with the minimal sum.If there are still multiple pairs,choose any one of them.
Decrease both elements in the pair by 1.
Remove all zeros from the array.
It's easy to see that this process always ends in a finite number of steps.
Choose the two elements that have the minimal absolute difference.If there are multiple such pairs,choose the one among them with the minimal sum.If there are still multiple pairs,choose any one of them.
Decrease both elements in the pair by 1.
Remove all zeros from the array.
It's easy to see that this process always ends in a finite number of steps.
▼优质解答
答案和解析
array可以是排列,阵容,级数,数组.由于不知道你这段话出自哪个领域,姑且译成“序列”.
现有一正整数序列,对该序列重复下列操作,直到剩余的数的个数少于两个:
选择具有最小的绝对差的两个数,如果有多组这样的数,选择其中和最小的一组.如果仍有多组,选择其中任何一组,
将这两个数各减去1,
去掉序列中所有的0.
容易看出,上述操作总是包含有限个步骤.
现有一正整数序列,对该序列重复下列操作,直到剩余的数的个数少于两个:
选择具有最小的绝对差的两个数,如果有多组这样的数,选择其中和最小的一组.如果仍有多组,选择其中任何一组,
将这两个数各减去1,
去掉序列中所有的0.
容易看出,上述操作总是包含有限个步骤.
看了 Wehaveanarrayo...的网友还看了以下:
已知烯烃、炔烃在臭氧的作用下发生以下反应:CH3-CH═CH-CH2-CH═CH2→CH3CHO+ 2020-05-04 …
化学--有机化学基础已知:醛分子间可相互发生缩合反应,这是使碳链增长的重要方式之一,例如:R-CH 2020-05-04 …
有机方程式OHC-CHO+Ag(NH3)2OH(足量)→苯环-CHO+H2→CH3CH(OH)CH 2020-05-04 …
英语翻译sorry anh,em ko muon anh lam cho anh buon dau 2020-05-14 …
糖类和油脂的元素组成分别是A.CHO和CHOB.CHO和CHONC.CHO和CHOPD.CHO和C 2020-05-15 …
英语翻译Chi dang chat chu?khong em o day lam co mat k 2020-05-17 …
Wehaveanarrayofpositiveintegers.Wewilltransformth 2020-05-17 …
写出下列反应方程式1OHC-CHO和H2加成2C6H5-CHO催化氧化3OHC-CHO和新制CU( 2020-05-24 …
环状CHO生成COOH环状含CHO(左边还有碳碳双键)怎样将CHO变COOH,碳碳双键留着,是变C 2020-06-02 …
若4.6克乙醇完全燃烧的产物中CO2的质量是8.8克H2O的质量是5.4克则乙醇中CHO元素的质量 2020-06-05 …