結果

問題 No.52 よくある文字列の問題
ユーザー ゆるくゆるく
提出日時 2014-10-29 00:10:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 99,004 KB
最終ジャッジ日時 2023-08-28 22:56:17
合計ジャッジ時間 3,071 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,056 KB
testcase_01 AC 29 ms
9,920 KB
testcase_02 AC 337 ms
9,888 KB
testcase_03 AC 30 ms
9,896 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 30 ms
9,960 KB
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy

s = str(input())
s1 = list(s)
s2 = list(s)
s2.reverse()
a = s1.pop()
b = s2.pop()
d = defaultdict(dict)
for ss in itertools.permutations(s1):
    d[(a + "".join(ss))] = 1
for ss in itertools.permutations(s2):
    d[(b + "".join(ss))] = 1
print(len(d))
0