Submission #66299304
Source Code Expand
import sys
import math
from collections import Counter
from collections import defaultdict as dd, deque
from bisect import bisect_left as bl , bisect_right as br
from heapq import heappush, heappop
from math import gcd, floor, ceil, log2, sqrt , isqrt
from functools import lru_cache
from itertools import groupby as gb
sys.setrecursionlimit(1000000)
MOD = 10**9 + 7
N = 10**6 + 5
sieve = [1] * (N)
sieve[0] = sieve[1] = 0
fac = [1 for i in range(N)]
ifac = [1 for i in range(N)]
primes = []
def soe():
for i in range(2, N):
if sieve[i] == 1:
for j in range(i*i, N, i):
sieve[j] = 0
for i in range(N):
if sieve[i]:
primes.append(i)
def compute_factorials():
for i in range(1, N):
fac[i] = fac[i-1] * i % MOD
ifac[-1] = pow(fac[-1], MOD - 2, MOD)
for i in range(N-2, -1, -1):
ifac[i] = ifac[i+1] * (i+1) % MOD
def factorize(x):
factors = []
while x != 1:
factors.append(spf[x])
x //= spf[x]
return factors
def is_prime(x):
return x > 1 and sieve[x] == 0
def comb(n , r):
return fac[n] * ifac[r] % MOD * ifac[n - r] % MOD
def perm(n ,r):
return fac[n] * ifac[n - r] % MOD
input = sys.stdin.readline
take_int = lambda: int(input())
take_line = lambda: map(int, input().split())
take_list = lambda: list(map(int, input().split()))
take_string = lambda: list(input().strip().split())
print_list = lambda x: print(*x)
def solve():
n = take_int()
l = take_list()
print(len(sorted(list(set(l)))))
print_list(sorted(list(set(l))))
solve()
Submission Info
| Submission Time | |
|---|---|
| Task | B - Compression |
| User | Maddy_22 |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 150 |
| Code Size | 1690 Byte |
| Status | AC |
| Exec Time | 96 ms |
| Memory | 106512 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 150 / 150 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 93 ms | 106460 KiB |
| 00_sample_01.txt | AC | 94 ms | 106384 KiB |
| 00_sample_02.txt | AC | 93 ms | 106512 KiB |
| 01_random_00.txt | AC | 95 ms | 106272 KiB |
| 01_random_01.txt | AC | 94 ms | 106396 KiB |
| 01_random_02.txt | AC | 94 ms | 106104 KiB |
| 01_random_03.txt | AC | 94 ms | 106448 KiB |
| 01_random_04.txt | AC | 96 ms | 106276 KiB |
| 01_random_05.txt | AC | 94 ms | 106432 KiB |
| 01_random_06.txt | AC | 95 ms | 106436 KiB |
| 01_random_07.txt | AC | 95 ms | 106184 KiB |
| 01_random_08.txt | AC | 95 ms | 106084 KiB |
| 01_random_09.txt | AC | 95 ms | 106112 KiB |
| 01_random_10.txt | AC | 95 ms | 106332 KiB |
| 01_random_11.txt | AC | 95 ms | 106260 KiB |
| 01_random_12.txt | AC | 95 ms | 106380 KiB |
| 01_random_13.txt | AC | 95 ms | 106456 KiB |
| 01_random_14.txt | AC | 95 ms | 106352 KiB |
| 01_random_15.txt | AC | 94 ms | 106480 KiB |
| 01_random_16.txt | AC | 95 ms | 106192 KiB |
| 01_random_17.txt | AC | 95 ms | 106284 KiB |