結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2015-04-16 23:22:31 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 36,960 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 18:40:56 |
合計ジャッジ時間 | 2,032 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", A+i); | ~~~~~^~~~~~~~~~~
ソースコード
#include <cstdio>#include <algorithm>int main(){int N;scanf("%d", &N);int A[100000];for(int i=0;i<N;i++){scanf("%d", A+i);}std::sort(A, A+N);int count = 0;for(int i=0,j=0;i<N;){while(j < N && A[j] == A[i]){j++;}if(j-i == 1){count++;}i = j;}printf("%d\n", count);}