Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129159 李朋秦 两个数的最小距离 C++ Wrong Answer 2 MS 276 KB 546 2025-08-22 14:21:32

Tests(2/15):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ long long n,a[1001],c; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } int min=abs(a[1]-a[0]); for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ c=abs(a[i]-a[j]); if(min>c)min=c; } } cout<<min; return 0; }


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-----
-986489864