結果
問題 | No.182 新規性の虜 |
ユーザー |
|
提出日時 | 2018-08-18 16:49:19 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 1,180 ms |
コンパイル使用メモリ | 29,056 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 06:55:33 |
合計ジャッジ時間 | 2,515 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <stdio.h> #include <stdlib.h> int asc(const void *a, const void *b) { return *(int*)a - *(int*)b; } int main(void) { int N; int A[100000]; int i, j; int count, s; scanf("%d", &N); for (i = 0; i < N; i++) { scanf("%d", &A[i]); } qsort(A, N, sizeof(int), asc); i = 0; count = 0; while (i < N) { for (j = i+1, s = 0; (j < N) && (A[i] == A[j]); j++, s++) { } if (!s) { count++; i++; } else { i = j; } } printf("%d\n", count); return 0; }