Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6703 黄言岐 两个数的最小距离II C++ Wrong Answer 1 MS 264 KB 577 2025-03-12 20:39:14

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); } } cout<<_min<<endl; return 0; }


Run Info:

------Input------
815 -709065349 945173367 793167292 -727297898 961459714 -525333008 357981149 -338216299 -790533583 175147282 -401929630 -595452787 174419119 -661528496 558727304 -764073687 42336268 713919276 718589230 -362134115 -695301394 -989727546 -94274536 -758484291 966527063 373881347 701252276 886415446 81607364 408192422 713538653 -923309753 -224127040 823491298 -544895962 463208467 457572653 -143715549 627234529 590527846 595864830 19536503 -157698889 -93573607 407628058 -626627387 -632379383 -35164649
------Answer-----
389 747
------Your output-----
1956