Submission #19503050


Source Code Expand

Copy
#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << (x) << '\n'
#define debugArray(x, n)                                      \
  cerr << __LINE__ << ": " << #x << " = {";                   \
  for (long long hoge = 0; (hoge) < (long long)(n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];                   \
  cerr << "}" << '\n'
#define debugMatrix(x, h, w)                                         \
  cerr << __LINE__ << ": " << #x << " =\n";                          \
  for (long long hoge = 0; (hoge) < (long long)(h); ++(hoge)) {      \
    cerr << ((hoge ? " {" : "{{"));                                  \
    for (long long fuga = 0; (fuga) < (long long)(w); ++(fuga))      \
      cerr << ((fuga ? ", " : "")) << x[hoge][fuga];                 \
    cerr << "}" << (hoge + 1 == (long long)(h) ? "}" : ",") << '\n'; \
  }
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#define debugMatrix(x, h, w) (void(0))
#endif

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int N;
  cin >> N;
  string S[N];
  for (int i = 0; i < N; i++) cin >> S[i];
  string ans = S[0] + S[1];
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      if (i != j) {
        string tmp = S[i] + S[j];
        if (ans > tmp) ans = tmp;
      }
  cout << ans << '\n';
  return 0;
}

Submission Info

Submission Time
Task B - パスワード
User hashiryo
Language C++ (GCC 9.2.1)
Score 100
Code Size 1634 Byte
Status AC
Exec Time 9 ms
Memory 3620 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 24
Set Name Test Cases
All input_0.txt, input_1.txt, input_10.txt, input_11.txt, input_12.txt, input_13.txt, input_14.txt, input_15.txt, input_16.txt, input_17.txt, input_18.txt, input_19.txt, input_2.txt, input_20.txt, input_21.txt, input_22.txt, input_23.txt, input_3.txt, input_4.txt, input_5.txt, input_6.txt, input_7.txt, input_8.txt, input_9.txt
Case Name Status Exec Time Memory
input_0.txt AC 9 ms 3496 KB
input_1.txt AC 3 ms 3488 KB
input_10.txt AC 2 ms 3556 KB
input_11.txt AC 7 ms 3608 KB
input_12.txt AC 3 ms 3608 KB
input_13.txt AC 2 ms 3600 KB
input_14.txt AC 2 ms 3600 KB
input_15.txt AC 2 ms 3500 KB
input_16.txt AC 2 ms 3620 KB
input_17.txt AC 2 ms 3592 KB
input_18.txt AC 2 ms 3488 KB
input_19.txt AC 3 ms 3508 KB
input_2.txt AC 2 ms 3600 KB
input_20.txt AC 2 ms 3500 KB
input_21.txt AC 2 ms 3484 KB
input_22.txt AC 2 ms 3552 KB
input_23.txt AC 2 ms 3548 KB
input_3.txt AC 2 ms 3560 KB
input_4.txt AC 2 ms 3500 KB
input_5.txt AC 2 ms 3596 KB
input_6.txt AC 3 ms 3600 KB
input_7.txt AC 2 ms 3600 KB
input_8.txt AC 2 ms 3476 KB
input_9.txt AC 6 ms 3596 KB