結果

問題 No.135 とりあえず1次元の問題
ユーザー MizunoMizuno
提出日時 2024-10-11 12:15:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 984 ms
コンパイル使用メモリ 69,376 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 12:15:05
合計ジャッジ時間 2,098 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
5,248 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 2 ms
5,248 KB
testcase_20 WA -
testcase_21 AC 35 ms
5,248 KB
testcase_22 AC 33 ms
5,248 KB
evil01.txt AC 32 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    
    
}
0