結果

問題 No.716 距離
ユーザー どららどらら
提出日時 2018-07-27 22:30:12
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 1,741 ms
コンパイル使用メモリ 171,016 KB
実行使用メモリ 9,204 KB
最終ジャッジ日時 2023-09-18 09:55:13
合計ジャッジ時間 4,427 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
8,492 KB
testcase_01 AC 67 ms
7,764 KB
testcase_02 AC 67 ms
7,500 KB
testcase_03 AC 68 ms
8,780 KB
testcase_04 AC 68 ms
7,412 KB
testcase_05 AC 67 ms
7,792 KB
testcase_06 AC 67 ms
7,524 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 48 ms
8,092 KB
testcase_11 AC 14 ms
4,376 KB
testcase_12 AC 63 ms
9,204 KB
testcase_13 AC 43 ms
8,288 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 56 ms
7,888 KB
testcase_16 AC 24 ms
5,376 KB
testcase_17 AC 60 ms
8,196 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 16 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 7 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 47 ms
7,096 KB
testcase_25 AC 15 ms
4,380 KB
testcase_26 AC 28 ms
5,096 KB
testcase_27 AC 35 ms
5,116 KB
testcase_28 AC 3 ms
4,376 KB
testcase_29 AC 30 ms
5,176 KB
testcase_30 AC 28 ms
5,188 KB
testcase_31 AC 43 ms
7,668 KB
testcase_32 AC 34 ms
5,176 KB
testcase_33 AC 31 ms
5,168 KB
testcase_34 AC 22 ms
5,064 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 5 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 11 ms
4,376 KB
testcase_39 AC 30 ms
5,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;
  vector<int> v;
  rep(i,N){
    int a;
    cin >> a;
    v.push_back(a);
  }
  vector<int> w;
  rep(i,N){
    rep(j,N){
      if(i==j) continue;
      w.push_back(abs(v[i]-v[j]));
    }
  }
  sort(ALLOF(w));
    
  cout << w[0] << endl;
  cout << w.back() << endl;
  
  return 0;
}
0