题解 1164: 数组的距离

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

筛选

《秒杀数组距离》

摘要:解题思路:由于不知道数组大小,利用malloc函数申请动态内存(需要用到<stdlib.h>或<malloc.h>库函数)。·······用两层循环比较数组元素的差(这里用三目运算较快)。注意事项: ……

数组的距离

摘要:#include #include using namespace std; int main() {     int num1,num2,a[1010],b[1010],temp,sum=……

数组的距离-Python

摘要:解题思路:    没有技巧,直接全部算出来取最小哈哈,说下代码思路    以a1 a2 a3 a4 a5       b1 b2 b3 b4 b5 为例(ai, bi, i=1,2,3,4,5)   ……

数组的距离(简单嘞C++)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; #include<algorithm> #include<cmath> int m……

C语言通俗易懂

摘要: #include #include // 循环暴力算法,一个一个比较就好 int main() { // 初始化值(也可以用动态内存开辟数组) int f[1000]……

1164: 数组的距离

摘要:```cpp #include #include using namespace std; struct number { int value,flag; }; int mai……

数组的距离

摘要:#解题思路 首先,这道题数据量不大,也不难,我们只需要从小到大排序一遍,找两个相邻的不同数组里元素的差最小的那个就行了,对于不同数组的这个条件,我们进行简单的记录一下就行,只需要遍历一次就行,没必要……

数组的距离

摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class ShuZuChA {    public static void main(String[] ……

1164: 数组的距离(绝对值abs)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>#include<cmath>using namespace std;int main(){  ……