Submission #67971767


Source Code Expand

import sys
import os
from math import ceil, floor, sqrt, pi, factorial, gcd,lcm,sin,cos,tan,asin,acos,atan2,exp,log,log10, isqrt, comb
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import cmp_to_key, lru_cache, reduce, cache
from operator import add, iand, ior, itemgetter, mul, xor
from string import ascii_lowercase, ascii_uppercase, ascii_letters
from typing import *
from bisect import bisect, bisect_left, bisect_right
from heapq import heapify, heappop, heappush, heappushpop, nlargest, nsmallest
from sortedcontainers import SortedSet, SortedList, SortedDict
from itertools import product, accumulate,permutations,combinations, count, groupby
input = lambda: sys.stdin.readline().rstrip("\r\n")
I = input
II = lambda: int(I())
LI = lambda: list(input().split())
LII = lambda: list(map(int, input().split()))
sys.setrecursionlimit(10000000)
inf = float('inf')

N,K,X = LII()
S = [I() for _ in range(N)]

S.sort()

# table = []
# x = X-1
# for i in range(K):
#     table.append(x%N)
#     x //= N
# table.reverse()

# ans = []
# for i in range(K):
#     ans.append(S[table[i]])
# print("".join(ans))

table = []
for p in product(range(N), repeat=K):
    a = [S[i] for i in p]
    table.append("".join(a))

table.sort()
print(table[X-1])

Submission Info

Submission Time
Task C - Concat (X-th)
User GeekMasahiro
Language Python (PyPy 3.10-v7.3.12)
Score 300
Code Size 1332 Byte
Status AC
Exec Time 215 ms
Memory 97240 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 27
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_06.txt, hand_07.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 163 ms 86832 KiB
hand_02.txt AC 215 ms 95412 KiB
hand_03.txt AC 164 ms 87036 KiB
hand_04.txt AC 209 ms 94956 KiB
hand_06.txt AC 161 ms 86368 KiB
hand_07.txt AC 160 ms 86312 KiB
random_01.txt AC 188 ms 95076 KiB
random_02.txt AC 177 ms 92748 KiB
random_03.txt AC 163 ms 86316 KiB
random_04.txt AC 157 ms 86356 KiB
random_05.txt AC 185 ms 95456 KiB
random_06.txt AC 161 ms 86408 KiB
random_07.txt AC 162 ms 86276 KiB
random_08.txt AC 167 ms 86876 KiB
random_09.txt AC 204 ms 95604 KiB
random_10.txt AC 169 ms 87000 KiB
random_11.txt AC 198 ms 94800 KiB
random_12.txt AC 168 ms 88384 KiB
random_13.txt AC 210 ms 95736 KiB
random_14.txt AC 160 ms 86284 KiB
random_15.txt AC 158 ms 86312 KiB
random_16.txt AC 163 ms 86240 KiB
random_17.txt AC 190 ms 97200 KiB
random_18.txt AC 188 ms 97240 KiB
random_19.txt AC 162 ms 86400 KiB
sample_01.txt AC 159 ms 86048 KiB
sample_02.txt AC 165 ms 87044 KiB