結果
| 問題 |
No.182 新規性の虜
|
| コンテスト | |
| ユーザー |
ikd
|
| 提出日時 | 2015-11-02 13:32:03 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 471 bytes |
| コンパイル時間 | 643 ms |
| コンパイル使用メモリ | 57,812 KB |
| 最終ジャッジ日時 | 2024-11-14 19:23:55 |
| 合計ジャッジ時間 | 1,187 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:5: error: ‘vector’ was not declared in this scope
12 | vector<long long int> a(n);
| ^~~~~~
main.cpp:5:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
4 | #include<map>
+++ |+#include <vector>
5 |
main.cpp:12:12: error: expected primary-expression before ‘long’
12 | vector<long long int> a(n);
| ^~~~
main.cpp:14:15: error: ‘a’ was not declared in this scope
14 | cin>> a[i];
| ^
main.cpp:19:12: error: ‘a’ was not declared in this scope
19 | ma[a[i]]++;
| ^
ソースコード
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;
int main(){
int n;
cin>> n;
vector<long long int> a(n);
for(int i=0; i<n; i++){
cin>> a[i];
}
map<int, int> ma;
for(int i=0; i<n; i++){
ma[a[i]]++;
}
int ans=0;
auto it = ma.begin();
for(it; it!=ma.end(); it++){
if(it->second==1){
ans++;
}
}
cout<< ans<< endl;
return 0;
}
ikd