Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140196 万骏博 两个数的最小距离 C++ Accepted 1 MS 276 KB 372 2025-12-13 16:54:45

Tests(15/15):


Code:

#include<bits/stdc++.h> using namespace std; long long o[1001],l=9999999999,n,m; int main(){ scanf("%lld",&n); for(int i=1;i<=n;i++){ scanf("%lld",&o[i]); } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(i!=j){ m=abs(o[i]-o[j]); if(m<l){ l=m; } } } } printf("%lld",l); return 0; }