結果
問題 | No.52 よくある文字列の問題 |
ユーザー |
|
提出日時 | 2018-08-14 04:31:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-22 05:36:29 |
合計ジャッジ時間 | 992 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
ソースコード
from sys import stdin, stdout input = lambda: stdin.readline().rstrip() write = stdout.write def operation(s): l = len(s) a = [0] * l ret = set() def ope_(s): if len(s) == 1: a[-1] = s ret.add(tuple(a)) return i = l - len(s) a[i] = s[0]; ope_(s[1:]) a[i] = s[-1]; ope_(s[:-1]) ope_(s) return ret def main(): S = input() ret = operation(S) print(len(ret)) main()