結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー | monburan_0401 |
提出日時 | 2018-09-05 15:37:20 |
言語 | C (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 763 bytes |
コンパイル時間 | 796 ms |
コンパイル使用メモリ | 31,744 KB |
実行使用メモリ | 8,740 KB |
最終ジャッジ日時 | 2024-04-27 14:23:37 |
合計ジャッジ時間 | 12,763 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | -- | - |
evil01.txt | -- | - |
ソースコード
#include <stdio.h> #include <math.h> #include <stdlib.h> int main(void){ int N; int num[100000]; int min; // 求める最小値 int L; // 差の絶対値(2点間の距離) scanf("%d",&N); for(int i = 0; i < N; i++){ scanf("%d",&num[i]); } int change; for(int i = 0; i < N; i++){ for(int j = i; j < N; j++){ if(num[i] > num[j]){ change = num[i]; num[i] = num[j]; num[j] = change; } } } min = 1000000000; // 入力の最大値 for(int j = 0; j < N-1; j++){ for(int k = j; k < N; k++){ L = abs(num[k] - num[j]); if( (L < min) && (L != 0) ){ min = L; } } } if(min == 1000000000){ printf("0\n"); return 0; } printf("%d\n",min); return 0; }