Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6608 张文曦 矩阵对角线 C++ Wrong Answer 0 MS 264 KB 559 2025-03-08 14:58:24

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() #include<limits.h> using namespace std; int main(){ long long _min=LLONG_MAX,n,a[1001],temp; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ temp=a[i]; for(int j=1;j<=n;j++){ _min=min(abs(temp-a[j]),_min); } } cout<<_min; return 0; }


Run Info:

------Input------
6 10 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6
------Answer-----
11 2 3 4 5 16 1 12 3 4 15 6 1 2 13 14 5 6 1 2 13 14 5 6 1 12 3 4 15 6 11 2 3 4 5 16
------Your output-----
0