結果

問題 No.182 新規性の虜
ユーザー ElkElk
提出日時 2018-05-27 15:09:55
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,016 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 26,184 KB
実行使用メモリ 7,796 KB
最終ジャッジ日時 2023-09-11 04:13:32
合計ジャッジ時間 9,541 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2,494 ms
4,380 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 check(int A, int list[], int list_cnt){
    int i, ret = 0;
    for(i = 0; i < list_cnt; i++){
        if(A == list[i]){
            ret = 1;
            break;
        }
    }
    return ret;
}

int main(){
    int N, i, j, list_cnt = 0, cnt = 0, new_n = 0;
    int A[100000], list[100000];

    scanf("%d\n", &N);
    for(i = 0; i < N; i++){
        scanf("%d", &A[i]);
    }
    for(i = 0; i < N; i++){
        if(check(A[i], list, list_cnt) != 1){
            for(j = 0; j < N; j++){
                if(A[i] != A[j]){
                    cnt++;
                    //printf("i %d j %d cnt %d\n", i, j, cnt);
                }else if(i != j){
                    break;
                }
                if(cnt == N - 1){
                    new_n++;
                    list[list_cnt++] = A[i];
                    //printf("new i %d j %d\n", i, j);
                    break;
                }
            }
        }
        cnt = 0;
    }


    printf("%d\n", new_n);

    return 0;
}
0