結果

問題 No.182 新規性の虜
ユーザー Mcpu3Mcpu3
提出日時 2018-04-16 00:23:34
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 29,380 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-09 09:18:30
合計ジャッジ時間 34,918 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
	int n, *a;
	char str[32], *ch;
	scanf("%d%*c", &n);
	a = malloc(sizeof(int)*n);
	fgets(str, sizeof(str), stdin);
	ch = strtok(str, " \n");
	for (int i = 0; i < n; i++) {
		if (ch == NULL) break;
		else a[i] = atoi(ch);
		ch = strtok(NULL, " \n");
	}
	int x, sum = 0;
	for (int i = 0; i < n; i++) {
		x = 0;
		for (int j = 0; j < n; j++) if (a[i] == a[j]) x++;
		if (x > 1) sum++;
	}
	sum = n - sum;
	printf("%d\n", sum);
	free(a);
	return 0;
}
0