結果

問題 No.3714 Prefix Team Name
コンテスト
ユーザー tau1235
提出日時 2026-09-18 21:23:00
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 651 ms / 2,000 ms
+ 591µs
コード長 465 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,311 ms
コンパイル使用メモリ 343,368 KB
実行使用メモリ 151,296 KB
最終ジャッジ日時 2026-09-18 21:23:28
合計ジャッジ時間 10,450 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

int main(){
  string x,y,z;
  cin>>x>>y>>z;
  set<string> st;
  for (int i=1;i<=(int)x.size();i++) for (int j=1;j<=(int)y.size();j++) for (int k=1;k<=(int)z.size();k++){
    string sx=x.substr(0,i),sy=y.substr(0,j),sz=z.substr(0,k);
    st.insert(sx+sy+sz);
    st.insert(sx+sz+sy);
    st.insert(sy+sx+sz);
    st.insert(sy+sz+sx);
    st.insert(sz+sx+sy);
    st.insert(sz+sy+sx);
  }
  cout<<(int)st.size()<<endl;
}
0