結果
| 問題 | No.52 よくある文字列の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-14 04:31:49 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 93 ms / 5,000 ms |
| + 761µs | |
| コード長 | 471 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,468 KB |
| 実行使用メモリ | 15,784 KB |
| 最終ジャッジ日時 | 2026-09-02 05:24:13 |
| 合計ジャッジ時間 | 2,609 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()