双指针法 找两个数组的最小距离 摘要:解题思路:利用双指针法 对两个数组进行排序 分别指向数组 让两个值不断靠近 这样就是最小距离注意:结束只要一个数组遍历完 就已经是最小值了要用到qsort()函数 以及 abs()函数 在#inclu…… 题解列表 2025年12月29日 0 点赞 0 评论 46 浏览 评分:0.0
1164的基础解法 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int max(int a[],int n){ int i=0; int x=a[…… 题解列表 2025年11月09日 0 点赞 0 评论 136 浏览 评分:0.0
非常ez,随便看懂 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int m, n; scanf("%d %d", &m, &n); int a[…… 题解列表 2024年12月29日 0 点赞 0 评论 1063 浏览 评分:0.0
1164: 数组的距离- 极简 摘要:解题思路:双指针算法注意事项:参考代码:#include<iostream> #include<cmath> using namespace std; const int N = 1e3 + 1…… 题解列表 2024年09月04日 0 点赞 0 评论 387 浏览 评分:0.0
暴力(c语言代码) 摘要:```c #include #include int main() { int n, m; // 用于存储两个数组的大小 scanf("%d %d", &n, &m…… 题解列表 2024年09月02日 0 点赞 0 评论 412 浏览 评分:0.0
拿捏,已知元素从小到大排列的两个数组x[]和y[],请写出一个程序算出两个数组彼此之间差的绝对值中最小的一个,这叫做数组的距离 摘要:解题思路:输入,迭代器迭代,做差,比较,赋值,输出注意事项:调试信息屏蔽掉参考代码:#include <iostream> #include <vector> #include <cmath> …… 题解列表 2024年08月19日 0 点赞 0 评论 502 浏览 评分:0.0
1164数组的距离(分类讨论) 摘要:解题思路:注意此题已经说明了是从大到小了,求最小的绝对值无非就是 判断最大值小的 那个数组所处的位置在哪就可以求解了,不要想太复杂!!!注意事项:参考代码:#include<iostream>#inc…… 题解列表 2024年07月10日 1 点赞 0 评论 444 浏览 评分:8.0
数组距离简单求解 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<algorithm>using namespace std;void InPut(v…… 题解列表 2024年05月15日 0 点赞 0 评论 422 浏览 评分:0.0
常规思想求数组间距离 摘要:设置三个数组,其中两个用来存放数据,另外一个用来放两个数组中每个数相乘的积的绝对值。 最后遍历该数值求最小值。 #include #include int main() …… 题解列表 2024年03月19日 0 点赞 0 评论 462 浏览 评分:0.0
1164: 数组的距离(绝对值abs) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>#include<cmath>using namespace std;int main(){ …… 题解列表 2024年03月13日 1 点赞 0 评论 492 浏览 评分:9.9