結果

問題 No.182 新規性の虜
ユーザー しめはじめしめはじめ
提出日時 2019-08-08 17:43:16
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 28,112 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-26 01:16:41
合計ジャッジ時間 2,357 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
int main(void){
    int n;
    scanf( "%d", &n );
    int i;
    int num[3];
    int ans = 0;
    if( n == 1 ){
        ans = 1;
    }else{
        scanf( "%d", &num[0] );
        scanf( "%d", &num[1] );
        if( n == 2 ){
            if( num[0] == num[1] ){
                ans = 0;
            }else{
                ans = 1;
            }
        }else{
            if( num[0] != num[1] ){
                ans++;
            }
            for( i = 3; i <= n; i++ ){
                scanf( "%d", &num[2] );
                if( num[0] != num[1] && num[1] != num[2] ){
                    ans++;
                }
                //ずらす
                if( i < n ){
                    num[0] = num[1];
                    num[1] = num[2];
                }
            }
            if( num[1] < num[2] ){
                ans++;
            }
        }
    }
    printf( "%d\n", ans );
}
0