Submission #5400982


Source Code Expand

#!/usr/bin/env python3
import sys
from collections import defaultdict


def solve(N: int, A: "List[int]"):
    L = [0] * (100001)
    for a in A:
        L[a] += 1
        if L[a] >= 3:
            L[a] -= 2
    c = L.count(2)
    p, q = divmod(c, 2)
    res = sum(L) - 2 * (p + q)
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task D - Card Eater
User schwarznecken
Language PyPy3 (2.4.0)
Score 400
Code Size 834 Byte
Status AC
Exec Time 220 ms
Memory 53532 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 171 ms 39152 KB
00_example_02.txt AC 169 ms 39152 KB
01.txt AC 169 ms 39152 KB
02.txt AC 197 ms 40688 KB
03.txt AC 175 ms 39280 KB
04.txt AC 170 ms 39280 KB
05.txt AC 174 ms 39280 KB
06.txt AC 213 ms 53156 KB
07.txt AC 215 ms 53156 KB
08.txt AC 216 ms 53156 KB
09.txt AC 215 ms 53156 KB
10.txt AC 216 ms 53532 KB
11.txt AC 215 ms 53156 KB
12.txt AC 218 ms 53156 KB
13.txt AC 220 ms 53156 KB
14.txt AC 213 ms 53156 KB
15.txt AC 213 ms 53532 KB