Submission #3600609
Source Code Expand
#include <iostream> #include <vector> #include <map> #include <algorithm> using namespace std; int main() { int N; cin >> N; vector<long long int> A; for(int i=0; i<N; i++) { long long int a; cin >> a; A.push_back(a); } map<long long int,int> m; for(int i=0; i<N; i++) { m[A[i]] = 0; } for(int i=0; i<N; i++) { m[A[i]]++; } vector<long long int> S; sort(A.begin(),A.end()); S.push_back(A[0]); for(int i=1; i<N; i++) { if(A[i]!=A[i-1]) S.push_back(A[i]); } int cnt = 0; for(int i=0; i<S.size(); i++) { if(m[S[i]]%2!=0) cnt++; } cout << cnt << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Write and Erase |
User | stu987 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 744 Byte |
Status | AC |
Exec Time | 114 ms |
Memory | 8820 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 42 ms | 1400 KB |
02.txt | AC | 43 ms | 1400 KB |
03.txt | AC | 114 ms | 8820 KB |
04.txt | AC | 45 ms | 1400 KB |
05.txt | AC | 103 ms | 6772 KB |
06.txt | AC | 53 ms | 1400 KB |
07.txt | AC | 26 ms | 1400 KB |
08.txt | AC | 58 ms | 1400 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |