Submission #3416816


Source Code Expand

# -*- coding: utf-8 -*-
n = int(input())
d = {}

for x in input().split():
    x = int(x)
    if x not in d:
        d[x] = 0
    d[x] += 1

cnt = 0
dcnt = 0
for k in d.keys():
    if d[k]%2==1:
        cnt += 1
    else:
        dcnt += 1

if dcnt%2==0:
    print(cnt+dcnt)
else:
    print(cnt+dcnt-1)

Submission Info

Submission Time
Task D - Card Eater
User mtakushi
Language Python (3.4.3)
Score 400
Code Size 325 Byte
Status AC
Exec Time 91 ms
Memory 22252 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 17
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 16 ms 2940 KB
00_example_02.txt AC 17 ms 3060 KB
01.txt AC 17 ms 3060 KB
02.txt AC 20 ms 3444 KB
03.txt AC 17 ms 3060 KB
04.txt AC 18 ms 3060 KB
05.txt AC 17 ms 2940 KB
06.txt AC 74 ms 10420 KB
07.txt AC 74 ms 10592 KB
08.txt AC 80 ms 10608 KB
09.txt AC 70 ms 10428 KB
10.txt AC 78 ms 9944 KB
11.txt AC 72 ms 10296 KB
12.txt AC 72 ms 9828 KB
13.txt AC 75 ms 10420 KB
14.txt AC 91 ms 22252 KB
15.txt AC 73 ms 10712 KB