結果

問題 No.2737 Compound Word
ユーザー SyNtAx_error_1
提出日時 2024-04-20 13:12:07
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 2,645 ms
コンパイル使用メモリ 165,300 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 08:37:17
合計ジャッジ時間 3,708 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (auto &s : S)
    cin >> s;
  set<string> st;
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N; j++)
      st.insert(S[i] + S[j]), st.insert(S[j] + S[i]);
  cout << st.size() << endl;
}
0