Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140198 田祥江 两个数的最小距离II C++ Wrong Answer 1 MS 272 KB 383 2025-12-13 16:56:21

Tests(0/15):


Code:

#include<bits/stdc++.h> using namespace std; int a[1000]; int main(){ int n,k,x,y; int min=999999; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(i!=j){ k=abs(a[i]-a[j]); if(k<min){ min=k; x=i; y=j; } } } } cout<<x<<y<<endl; }


Run Info:

------Input------
940 758926704 -960964048 -430141843 468532242 -880373592 683061267 519316474 147051688 719416223 901294929 930598316 344190816 -909295224 -703928603 982691789 -532274625 -865094105 -608855024 -180757338 -910192517 -725725557 -770344534 -56909888 323802311 -981526148 876907807 -238812122 904848323 -118180751 113460304 -343347383 -148747218 453083382 -135336696 -516925037 646757862 183906743 -276943828 -386044671 422454212 -202786322 -475659031 -893786081 -365403011 748358874 460671925 334228484 1
------Answer-----
357 665
------Your output-----
357665