Submission #4635482


Source Code Expand

#include<stdio.h>
#include<map>
using namespace std;

map<int, int> mp;

int main()
{
	//freopen("第五次-第三题.txt", "r", stdin);
	int n;
	scanf("%d", &n);
	int tmp;
	while (n--)
	{
		scanf("%d", &tmp);
		if (mp.find(tmp) == mp.end())
		{
			mp[tmp] = 1;
		}
		else
			mp[tmp]++;
	}
	map<int, int>::iterator it;
	int cnt = 0;
	for (it = mp.begin(); it != mp.end(); ++it)
	{
		if (it->second % 2 != 0)
			cnt++;
	}
	printf("%d", cnt);
}

Submission Info

Submission Time
Task C - Write and Erase
User Leon125
Language C++14 (GCC 5.4.1)
Score 300
Code Size 472 Byte
Status AC
Exec Time 56 ms
Memory 4864 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:15:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &tmp);
                    ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 11
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 256 KB
02.txt AC 13 ms 256 KB
03.txt AC 56 ms 4864 KB
04.txt AC 14 ms 256 KB
05.txt AC 49 ms 3328 KB
06.txt AC 18 ms 256 KB
07.txt AC 12 ms 256 KB
08.txt AC 24 ms 384 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