| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 64027 | 彭林江 | 两个数的最小距离 | C++ | Accepted | 1 MS | 280 KB | 360 | 2024-01-20 17:01:37 |
#include<iostream> #include<cmath> using namespace std; long long a[1001]; int main(){ int n; cin >> n; long long mn = 2e18; 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++){ long long jl = abs(a[i]-a[j]); if(jl < mn){ mn = jl; } } } cout << mn; return 0; }