結果
| 問題 | No.182 新規性の虜 |
| コンテスト | |
| ユーザー |
しめはじめ
|
| 提出日時 | 2019-08-09 12:18:09 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 610 bytes |
| 記録 | |
| コンパイル時間 | 103 ms |
| コンパイル使用メモリ | 29,824 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-19 06:44:02 |
| 合計ジャッジ時間 | 1,121 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 17 WA * 10 |
ソースコード
#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( "%d", &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 );
}
しめはじめ