結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2015-04-20 10:21:14 |
言語 | C90 (gcc 12.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 350 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 22,656 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 17:33:20 |
合計ジャッジ時間 | 3,493 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 RE * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&N); | ^~~~~~~~~~~~~~ main.c:16:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%d",&a); | ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> int main(){ int N; scanf("%d",&N); int i; int a; int map[100001]={}; int max=N; for (i = 0; i < N; ++i){ scanf("%d",&a); if(map[a]==1){max-=2;map[a]=2;} else if(map[a]==2)max--; else{map[a]=1;} } printf("%d\n",max); return 0; }