結果

問題 No.3714 Prefix Team Name
コンテスト
ユーザー GrayCoder
提出日時 2026-09-18 22:46:05
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 325 ms / 2,000 ms
+ 429µs
コード長 690 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 14,848 KB
実行使用メモリ 137,688 KB
最終ジャッジ日時 2026-09-18 22:46:18
合計ジャッジ時間 6,131 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
from itertools import accumulate, combinations, count, permutations, product


def input():
    return sys.stdin.readline()[:-1]


def main():
    X = input()
    Y = input()
    Z = input()

    arr, pre = [], []
    for s in (X, Y, Z):
        for i in range(1, len(s) + 1):
            arr.append(s[:i])
        pre.append(arr[:])
        arr.clear()

    name = set()
    for a in permutations(pre):
        for a0 in a[0]:
            for a1 in a[1]:
                for a2 in a[2]:
                    name.add(a0 + a1 + a2)
    print(len(name))


if __debug__:
    main()
else:
    import pprint

    with open(sys.argv[1], "r") as f:
        sys.stdin = f
        main()
0