| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 63603 | 何睿哲 | 两个数的最小距离 | C++ | Wrong Answer | 2 MS | 272 KB | 300 | 2024-01-19 11:27:15 |
#include<iostream> #include<cmath> using namespace std; int main(){ long long n,m=2e9; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ int x=abs(a[i]-a[j]); if(x<m){ m=x; } } } cout<<m; return 0; }
------Input------
2 -2147483648 2147483647
------Answer-----
4294967295
------Your output-----
1