当前位置:网站首页>[detailed explanation of Huawei machine test] check whether there is a digital combination that meets the conditions

[detailed explanation of Huawei machine test] check whether there is a digital combination that meets the conditions

2022-07-06 05:21:00 A less intelligent programmer


Preface

《 Detailed explanation of Huawei's machine test questions Python Realization 》 The column includes Huawei column of niuke.com 、 Huawei test questions 、 Huawei OD Real problem of machine test .

If you are preparing for Huawei's interview , If you want to know something, you can send me a private letter , I will try my best to help you , I can also give you some suggestions !

This paper solves the non optimal solution ( Non optimal performance ).

Title Description

Given an array of positive integers Check whether there is an array combination that meets the rule in the array

The rules : A=B+2C

Input description :

The first line outputs the number of elements of the array The next line outputs all array elements Space off

Output description :

If there is a number that meets the requirements Output in sequence in the same line In the rules A/B/C The value of Space off If there is no output 0

Example 1

Input :
4
2 7 3 0

Output :
7 3 2

explain :
7=3+2*2

Example 2

Input :
3

原网站

版权声明
本文为[A less intelligent programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060518571175.html