結果

問題 No.182 新規性の虜
ユーザー しめはじめしめはじめ
提出日時 2019-08-09 12:06:28
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 652 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 29,012 KB
実行使用メモリ 6,448 KB
最終ジャッジ日時 2023-09-26 12:13:58
合計ジャッジ時間 12,597 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
int main(void){
    int n;
    scanf( "%d", &n );
    int i, j, temp;
    int num[n + 2];
    int ans = 0;

    if( n == 1 ){
        ans = 1;
    }else{
    	num[0] = -1;
    	for( i = 0; i < n; i++ ){
    	    scanf( "%d", &num[i+1] );
    	}
    	num[n+1] = -1;

    	// ソート
    	for( i = 0; i < n; i++ ){
    		for( j = i + 1; j < n; j++ ){
    			if( num[i] > num[j] ){
    				temp = num[j];
    				num[j] = num[i];
    				num[i] = temp;
    			}
    		}
    	}

        for( i = 1; i <= n; i++ ){
    		if( num[i] != num[i+1] && num[i] != num[i-1] ){
    			ans++;
    		}
        }
    }
    printf( "%d\n", ans );
}
0