Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6609 黄言岐 两个数的最小距离 C++ Wrong Answer 0 MS 264 KB 644 2025-03-08 14:58:28

Tests(0/15):


Code:

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