Submission #67928288


Source Code Expand

#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
const int maxn = 2e5 + 5;
const long long p=998244353;
long long C[15][15];
vector<string> v;
string s[15];
int n,k,x;
void dfs(string now,int k)
{
    if (!k)
    {
        v.push_back(now);
        return;
    }
    for (int i=1;i<=n;i++)
        dfs(now+s[i],k-1);
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin>>n>>k>>x;
    string tmp;
    for (int i=1;i<=n;i++)
        cin>>s[i];
    dfs(tmp,k);
    sort(v.begin(),v.end());
    cout<<v[x-1];
}

Submission Info

Submission Time
Task C - Concat (X-th)
User Alliy666
Language C++ 23 (gcc 12.2)
Score 300
Code Size 667 Byte
Status AC
Exec Time 26 ms
Memory 12500 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 3536 KiB
hand_02.txt AC 26 ms 10156 KiB
hand_03.txt AC 1 ms 3460 KiB
hand_04.txt AC 23 ms 9020 KiB
hand_06.txt AC 1 ms 3484 KiB
hand_07.txt AC 1 ms 3484 KiB
random_01.txt AC 22 ms 9688 KiB
random_02.txt AC 14 ms 7900 KiB
random_03.txt AC 1 ms 3544 KiB
random_04.txt AC 1 ms 3416 KiB
random_05.txt AC 23 ms 10300 KiB
random_06.txt AC 1 ms 3328 KiB
random_07.txt AC 1 ms 3340 KiB
random_08.txt AC 1 ms 3780 KiB
random_09.txt AC 23 ms 10996 KiB
random_10.txt AC 2 ms 3492 KiB
random_11.txt AC 22 ms 9208 KiB
random_12.txt AC 4 ms 4528 KiB
random_13.txt AC 22 ms 10980 KiB
random_14.txt AC 1 ms 3492 KiB
random_15.txt AC 1 ms 3544 KiB
random_16.txt AC 1 ms 3348 KiB
random_17.txt AC 24 ms 12500 KiB
random_18.txt AC 18 ms 12496 KiB
random_19.txt AC 1 ms 3460 KiB
sample_01.txt AC 1 ms 3472 KiB
sample_02.txt AC 1 ms 3460 KiB