Submission #2864774
Source Code Expand
#include <iostream> #include <string> #include <vector> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> #include <map> #include <stack> #include <queue> #include <set> #include <cstring> using namespace std; // ascending order #define vsort(v) sort(v.begin(), v.end()) // descending order #define vsort_r(v) sort(v.begin(), v.end(), greater<int>()) // ascending order #define asort(array, N) sort(array, array + N) // descending order #define asort_r(array, N) sort(array, array + N, greater<int>()) #define vunique(v) v.erase(unique(v.begin(), v.end()), v.end()) #define mp make_pair #define ts(x) to_string(x) typedef long long ll; typedef pair<int, int> P; const ll INF = 1e18; ll N; vector<ll> d; int main(){ cin.tie(0); ios::sync_with_stdio(false); cin >> N; for(int i = 0; i < N; i++) { ll a; cin >> a; d.push_back(a); } vsort(d); int i = 0; int ans = 0; while(i < d.size()) { int tmp = d[i]; int j = i; int count = 0; while(true) { if(tmp == d[j]) { count++; j++; continue; } break; } i = j; if(count % 2 != 0) ans++; } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Write and Erase |
User | tsutarou10 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1194 Byte |
Status | AC |
Exec Time | 18 ms |
Memory | 1400 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 | 13 ms | 1400 KB |
02.txt | AC | 13 ms | 1400 KB |
03.txt | AC | 18 ms | 1400 KB |
04.txt | AC | 13 ms | 1400 KB |
05.txt | AC | 18 ms | 1400 KB |
06.txt | AC | 16 ms | 1400 KB |
07.txt | AC | 9 ms | 1400 KB |
08.txt | AC | 16 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 |