結果
問題 | No.716 距離 |
ユーザー |
|
提出日時 | 2018-07-27 22:36:59 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 1,205 ms |
コンパイル使用メモリ | 28,800 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-05 02:43:00 |
合計ジャッジ時間 | 2,320 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include <limits.h>int main(void) {int num, i, plot[1024];int max = 0, min = INT_MAX;scanf("%d", &num);for (i = 0; i < num; i++)scanf("%d", &plot[i]);for (i = 0; i < num - 1; i++) {if (abs(plot[i + 1] - plot[i]) < min)min = abs(plot[i + 1] - plot[i]);}max = plot[num - 1] - plot[0];printf("%d\n%d\n", min, max);return 0;}