結果

問題 No.406 鴨等間隔の法則
ユーザー NoiriNoiri
提出日時 2017-12-09 13:14:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 54,648 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 03:18:34
合計ジャッジ時間 2,256 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 33 ms
5,376 KB
testcase_05 AC 14 ms
5,376 KB
testcase_06 AC 15 ms
5,376 KB
testcase_07 AC 15 ms
5,376 KB
testcase_08 AC 34 ms
5,376 KB
testcase_09 AC 37 ms
5,376 KB
testcase_10 AC 16 ms
5,376 KB
testcase_11 AC 30 ms
5,376 KB
testcase_12 AC 20 ms
5,376 KB
testcase_13 AC 19 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 4 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 5 ms
5,376 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 7 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 22 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 37 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 38 ms
5,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 35 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
void selc(int n, int A[]){
    for(int i = 0; i < n; i++){
        int min = i;
        for(int j = i; j < n; j++){
            if(A[min] > A[j]) min = j;
        }
        int temp = A[i];
        A[i] = A[min];
        A[min] = temp;
    }
}
int main(){
    int n, x[100000];
    cin >> n;
    int flag = 0;
    for(int i = 0; i < n; i++) cin >> x[i];
    for(int i = 1; i < n; i++){
        if(x[i] != (x[1] - x[0]) * (i - 1) + x[0]){
            flag = 1;
            break;
        }
    }
    if(flag) cout << "NO" << endl;
    else cout << "YES" << endl;
    return 0;
}
0