結果

問題 No.716 距離
ユーザー michonz4
提出日時 2019-11-30 21:12:00
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,418 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 03:34:35
合計ジャッジ時間 2,453 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <limits.h>

int main() {
  int n, a1;
  scanf("%d %d", &n, &a1);
  
  int min=INT_MAX, tmp=a1, nLast;
  for (int i=1; i<n; i++) {
    int t;
    scanf("%d", &t);
    if (t-tmp<min) min=t-tmp;
    tmp=t;
    if (i==n-1) nLast=t;
  }

  printf("%d\n%d\n", min, nLast-a1);
}
0