結果

問題 No.3714 Prefix Team Name
コンテスト
ユーザー karinohito
提出日時 2026-09-18 21:26:51
言語 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  
実行時間 671 ms / 2,000 ms
+ 599µs
コード長 646 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,004 ms
コンパイル使用メモリ 362,208 KB
実行使用メモリ 151,424 KB
最終ジャッジ日時 2026-09-18 21:27:03
合計ジャッジ時間 11,131 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string X,Y,Z;
    cin>>X>>Y>>Z;
    int x=X.size();
    int y=Y.size();
    int z=Z.size();
    set<string> S;
    for(int i=1;i<=x;i++){
        for(int j=1;j<=y;j++){
            for(int k=1;k<=z;k++){
                vector<string> P={X.substr(0,i),Y.substr(0,j),Z.substr(0,k)};
                sort(P.begin(),P.end());
                do{
                    S.insert(P[0]+P[1]+P[2]);
                }while(next_permutation(P.begin(),P.end()));
            }
        }
    }
    cout<<S.size()<<"\n";
}
0