結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2017-07-07 22:49:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 330 bytes |
コンパイル時間 | 419 ms |
コンパイル使用メモリ | 57,748 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-06 10:07:45 |
合計ジャッジ時間 | 3,137 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 RE * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include<iostream> #include<cstdio> #include<vector> using namespace std; int main() { int n, a[100001] = {}, b[100000]; scanf("%d", &n); for (int i = 0; i < n; i++) { cin >> b[i]; a[b[i]] += 1; } int ans = 0; for (int i = 0; i < n; i++) { if (a[b[i]] == 1) { ans++; } } cout << ans << endl; return 0; }