結果
| 問題 |
No.52 よくある文字列の問題
|
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-10-16 09:15:15 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 5,000 ms |
| コード長 | 316 bytes |
| コンパイル時間 | 50 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 05:23:18 |
| 合計ジャッジ時間 | 689 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
S = raw_input()
dp = {(0,0):set([""])}
for i in xrange(len(S)):
ndp = {}
for k,s in dp.iteritems():
for f,b in ((1,0),(0,1)):
n = (k[0]+f,k[1]+b)
if n not in ndp:
ndp[n] = set()
for v in s:
ndp[n].add(v+(S[n[0]-1] if f else S[-n[1]]))
dp = ndp
print len(set(v for s in dp.values() for v in s))
Tawara