結果

問題 No.182 新規性の虜
ユーザー funakoshifunakoshi
提出日時 2019-08-09 17:03:13
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 993 bytes
コンパイル時間 1,585 ms
コンパイル使用メモリ 29,196 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-26 13:17:11
合計ジャッジ時間 12,000 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 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 2 ms
4,376 KB
testcase_08 AC 4,673 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>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

int main(void)
{
    int findnumtotal;
    scanf("%d",&findnumtotal);
    int findnum[100000]={0};
    for(int i=0;i<findnumtotal;i++)
    {
        scanf("%d",&findnum[i]);
    }
    for(int i=0;i<findnumtotal-1;i++)
    {
        for(int j=i+1;j<findnumtotal;j++)
        {
            if(findnum[i]>findnum[j])
            {
                int tmp=findnum[i];
                findnum[i]=findnum[j];
                findnum[j]=tmp;
            }
        }
    }
    int new=findnumtotal;
    bool duplicate=false;
    for(int i=0;i<findnumtotal-1;i++)
    {
        if(findnum[i]==findnum[i+1])
        {
            if(duplicate==false)
            {
                new-=2;
                duplicate=true;
            }
            else
            {
                new--;
            }
        }
        else
        {
            duplicate=false;
        }
        
        
    }
    printf("%d",new);
}
0