結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2019-08-09 12:29:58 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 20 ms / 5,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 1,047 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-19 06:44:06 |
合計ジャッジ時間 | 1,083 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <stdio.h> #include<stdlib.h> int compare_long(const void* a, const void* b) { return( *(long*)a - *(long*)b ); } int main(void){ int n; scanf( "%d", &n ); int i, j, temp; long num[n + 2]; int ans = 0; if( n == 1 ){ ans = 1; }else{ num[0] = -1; for( i = 0; i < n; i++ ){ scanf( "%ld", &num[(i+1)] ); } num[n+1] = 100000000001; qsort(num, n + 2, sizeof(long), compare_long); for( i = 1; i <= n; i++ ){ if( num[i] != num[i+1] && num[i] != num[i-1] ){ ans++; } } } printf( "%d\n", ans ); }