結果

問題 No.52 よくある文字列の問題
ユーザー GrayCoderGrayCoder
提出日時 2018-08-13 23:04:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 11,824 KB
実行使用メモリ 98,340 KB
最終ジャッジ日時 2023-10-24 16:51:31
合計ジャッジ時間 2,300 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,832 KB
testcase_01 AC 28 ms
9,832 KB
testcase_02 AC 304 ms
9,832 KB
testcase_03 AC 27 ms
9,832 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 26 ms
9,832 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
from sys import stdin, stdout

input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    S = input()

    strings = set()
    for s in permutations(S[:-1]):
        strings.add(S[-1] + ''.join(s))
    for s in permutations(S[1:]):
        strings.add(S[0] + ''.join(s))
    print(len(strings))

main()
0