题解 1164: 数组的距离

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

数组的距离-题解(Java代码)

摘要:解题思路:    纯暴力解法可能会超时,这里应用了区间解法遍历一次arr1数组 在她的左右两边区间长度为7的位置找最优(稍微带点贪心的思想)注意事项: 注意数组越界 和判断条件参考代码: public……

数组的距离-题解(C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include <math.h>         //绝对值函数,暴力求解int main(){ int m,n; int min; ……

python解决数组的距离

摘要:解题思路:注意事项:参考代码:m, n = map(int, input().strip().split()) f = list(eval(input().replace(&#39; &#39;, ……

1164: 数组的距离

```javaimportjava.util.Scanner;publicclass测试{publicstaticvoidmain(String[]args){Scannerscanner=newScanner(System.in);intm=scanner.nextInt();intn=scanne

C++递归解题《数组的距离》

###**注意:没有很好的处理递归,所以耗时可能会有所延长。####基本思路就是:对于一个递增数组,如果前一个数大于b,则它后面的数一定大于b,所以后面的数不用考虑,这样会节省很多时间。```cpp#include#includeusingnamespacestd;intm,

数组的距离

```pythonfrommathimportfabsa,b=input().split()l1=list(map(int,input().split()))l2=list(map(int,input().split()))ifl1[-1]

数组距离qdqdqwd

摘要:解题思路:注意事项:参考代码:#include "stdio.h"#include "math.h"int main() { int a, b; scanf("%d%d", &a, &b); int ……