Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6620 | 柯宇希 | 两个数的最小距离 | C++ | Wrong Answer | 1 MS | 272 KB | 584 | 2025-03-08 15:04:59 |
#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() #include<limits.h> using namespace std; int main(){ long long n,a[1001],temp; long long _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; }
------Input------
2 -2147483648 2147483647
------Answer-----
4294967295
------Your output-----
9223372036854775807