結果

問題 No.406 鴨等間隔の法則
ユーザー antyobiantyobi
提出日時 2019-05-05 12:06:00
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 28,844 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 22:34:36
合計ジャッジ時間 1,720 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,380 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 12 ms
4,376 KB
testcase_05 AC 5 ms
4,380 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 5 ms
4,384 KB
testcase_08 AC 13 ms
4,380 KB
testcase_09 AC 13 ms
4,380 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 10 ms
4,380 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 7 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 7 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 14 ms
4,380 KB
testcase_26 WA -
testcase_27 AC 14 ms
4,376 KB
testcase_28 AC 14 ms
4,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 13 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>
int main(){
    int i,yakusu,max=0,min=0,N,S[100000],data,flag=0;
    
    scanf("%d",&N);
    for(i=0;i<N;i++) scanf("%d",&S[i]);
    
    for(i=0;i<N;i++){
        if(max<S[i]) max=S[i];
        if(min>S[i]) min=S[i];
    }
    
    yakusu=(max-min)/(N-1);
    
    for(i=0;i<N;i++){
        data=abs(S[i]-S[i+1]);
        if(data%yakusu!=0){
            printf("NO\n");
            flag=1;
            break;
        }
    }
    if(flag==0)printf("YES\n");
}
0