提出 #67947047


ソースコード 拡げる

#include <bits/stdc++.h>
#define fs first
#define se second
using namespace std;
#define For(s,e)\
  for(int i=s;i<=e;++i)
#define ForR(s,e)\
  for(int i=s;i>=e;--i)
#define FOR(n) \
  for(int i=0;i<n;++i)
#define FORR(n) \
  for(int i=n-1;i>=0;--i)
#define IN(a,n) \
  FOR(n){\
    cin>>a[i];\
  }

string s[11];
void f(int d,int n,int m,string s1,vector<string>&ss){
  if(d==m){
    ss.emplace_back(s1);
    return;
  }
  for(int i=0;i<n;++i){
    f(d+1,n,m,s1+s[i],ss);
  }
}
int main(int /* argc */, char** /* argv */) {
  int n,m,x;
  cin>>n>>m>>x;
  for(int i=0;i<n;++i){
    cin>>s[i];
  }
  sort(s,s+n);
  vector<string>ss;
  f(0,n,m,string(),ss);
  sort(ss.begin(),ss.end());
  cout<<ss[x-1]<<endl;
  return 0;
}

提出情報

提出日時
問題 C - Concat (X-th)
ユーザ zz050201010
言語 C++ 23 (Clang 16.0.6)
得点 300
コード長 762 Byte
結果 AC
実行時間 23 ms
メモリ 12684 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 27
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
hand_01.txt AC 2 ms 3616 KiB
hand_02.txt AC 22 ms 10632 KiB
hand_03.txt AC 1 ms 3684 KiB
hand_04.txt AC 23 ms 9140 KiB
hand_06.txt AC 1 ms 3708 KiB
hand_07.txt AC 1 ms 3500 KiB
random_01.txt AC 18 ms 10068 KiB
random_02.txt AC 12 ms 8088 KiB
random_03.txt AC 1 ms 3528 KiB
random_04.txt AC 1 ms 3636 KiB
random_05.txt AC 18 ms 10284 KiB
random_06.txt AC 1 ms 3576 KiB
random_07.txt AC 1 ms 3500 KiB
random_08.txt AC 1 ms 3696 KiB
random_09.txt AC 21 ms 10824 KiB
random_10.txt AC 2 ms 3652 KiB
random_11.txt AC 21 ms 9404 KiB
random_12.txt AC 4 ms 4736 KiB
random_13.txt AC 22 ms 11124 KiB
random_14.txt AC 1 ms 3508 KiB
random_15.txt AC 1 ms 3532 KiB
random_16.txt AC 1 ms 3592 KiB
random_17.txt AC 20 ms 12684 KiB
random_18.txt AC 19 ms 12664 KiB
random_19.txt AC 1 ms 3628 KiB
sample_01.txt AC 1 ms 3488 KiB
sample_02.txt AC 1 ms 3536 KiB