結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-11 12:15:02 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 984 ms |
| コンパイル使用メモリ | 69,376 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 12:15:05 |
| 合計ジャッジ時間 | 2,098 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 16 |
ソースコード
#include <iostream>
#include <algorithm>
#include <climits>
#include <math.h>
using namespace std;
int main(void){
// Your code here!
int n;
cin >> n;
if(n <= 1){
cout << 0;
return 0;
}
int a,b,min = INT_MAX;
cin >> a;
for(int i = 0; i < (n - 1); i++) {
cin >> b;
if(a==b)continue;
if(min > abs(a - b)) min = abs(a - b);
a = b;
}
cout << min;
}