| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152347 | 李昱龙 | 两个数的最小距离 | C++ | Wrong Answer | 2 MS | 280 KB | 337 | 2026-04-25 14:37:42 |
#include<bits/stdc++.h> using namespace std; long long a[1001]; int main(){ long long m,n,sum; cin>>m; for(int i=1;i<=m;i++){ cin>>a[i]; } n=abs(a[2]-a[1]); for(int i=1;i<=m;i++){ for(int j=1;j<=m;j++){ if(i!=j){ sum=abs(a[i]-a[j]); } if(sum<n){ n=sum; } } } cout<<n; return 0; }
------Input------
2 -2147483648 2147483647
------Answer-----
4294967295
------Your output-----
4195064