Submission #67928806


Source Code Expand

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
using namespace std;

int main() {
    int N, K, X;
    cin >> N >> K >> X;
    X--;
    vector<string> S(N);
    for (int i = 0; i < N; i++) cin >> S[i];

    vector<string> T = {""};
    for (int i = 0 ; i < K; i++) {
        vector<string> tmp;
        tmp.reserve(100'000);
        for (auto&& t : T) {
            for (int j = 0; j < N; j++) {
                tmp.push_back(t + S[j]);
            }
        }

        swap(T, tmp);
    }

    sort(T.begin(), T.end());
    cout << T[X] << endl;

    // for (auto&& t : T)cout << t << ' ';
    // cout << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Concat (X-th)
User miyama_akane
Language C++ 20 (gcc 12.2)
Score 300
Code Size 829 Byte
Status AC
Exec Time 30 ms
Memory 17092 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 2 ms 3556 KiB
hand_02.txt AC 30 ms 12892 KiB
hand_03.txt AC 2 ms 3872 KiB
hand_04.txt AC 24 ms 11104 KiB
hand_06.txt AC 1 ms 3600 KiB
hand_07.txt AC 1 ms 3488 KiB
random_01.txt AC 23 ms 12292 KiB
random_02.txt AC 15 ms 10080 KiB
random_03.txt AC 1 ms 3532 KiB
random_04.txt AC 1 ms 3476 KiB
random_05.txt AC 24 ms 12968 KiB
random_06.txt AC 1 ms 3576 KiB
random_07.txt AC 1 ms 3492 KiB
random_08.txt AC 2 ms 3904 KiB
random_09.txt AC 25 ms 13944 KiB
random_10.txt AC 3 ms 3756 KiB
random_11.txt AC 24 ms 11496 KiB
random_12.txt AC 4 ms 5012 KiB
random_13.txt AC 26 ms 14056 KiB
random_14.txt AC 1 ms 3540 KiB
random_15.txt AC 1 ms 3488 KiB
random_16.txt AC 1 ms 3484 KiB
random_17.txt AC 28 ms 16752 KiB
random_18.txt AC 22 ms 17092 KiB
random_19.txt AC 1 ms 3492 KiB
sample_01.txt AC 1 ms 3560 KiB
sample_02.txt AC 2 ms 3552 KiB