Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2865 邓小龙 两个数的最小距离 C++ Wrong Answer 3 MS 5704 KB 423 2024-03-08 15:25:42

Tests(0/15):


Code:

# include<iostream> # include<cmath> # include<limits.h> # include<cstdio> using namespace std; long long a[1001],b[1001][1001]; int n; long long _min= INT_MAX+1; int main(){ cin>>n; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ b[i][j]=abs(a[i]-a[j]); _min=min(_min,b[i][j]); } } cout<<_min<<endl; }


Run Info:

------Input------
815 -1565614346 1742863086 1438850937 -1602079444 2013771743 1775435781 -1198149663 568478650 -823916245 -1728550813 202810917 -951342908 -1338389222 201354591 2116909072 1964976871 2132285156 1996681049 2008734458 -1470540639 969970961 2021180595 2066350391 1963517098 -1675631022 -62811112 1280354905 1289694812 -871751877 -1538086436 -2126938739 -336032719 -1664452230 1785570478 600279047 1255020905 1625347245 1973504939 15731080 668901196 1279593658 -1994103153 -595737728 1499498949 -123727557
------Answer-----
3912
------Your output-----
-2147483648