結果

問題 No.716 距離
ユーザー asdfghjkl;asdfghjkl;
提出日時 2020-03-12 02:51:41
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 401 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 15,296 KB
最終ジャッジ日時 2024-04-27 22:17:23
合計ジャッジ時間 6,606 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void){
    int max=0;
    int min=999999999;
int n;scanf("%d",&n);
int a[1005];
for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
}

for(int i=0;i<n;i++){
    for(int j=0;i<n;j++){
    if(i==j){continue;}
    if(abs(a[i]-a[j])>=max){max=(abs(a[i]-a[j]));}
    if(abs(a[i]-a[j])<=min){min=(abs(a[i]-a[j]));}
}
printf("%d\n%d",min,max);
}


}
0