結果

問題 No.1643 Not Substring
コンテスト
ユーザー lllllll88938494
提出日時 2022-08-19 00:14:14
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
MLE  
実行時間 -
コード長 630 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 661 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 533,896 KB
最終ジャッジ日時 2026-09-11 07:45:30
合計ジャッジ時間 6,724 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other MLE * 1 -- * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
sys.setrecursionlimit(10**6)

moji=set()
s=input()
n=len(s)

def  cal(ind):
    if ''.join(t) in moji:
        return
    if ind == len(s):
        moji.add(''.join(t))
        return
    moji.add(''.join(t))
    for i in range(ind,len(s)):
        t.append(s[i])
        cal(i+1)
        t.pop()
        
for i in range(len(s)):
    t=[s[i]]
    cal(i+1)

def  cal(ind):
    if len(t) > n+1:
        return
    if ''.join(t) not in moji:
        print(''.join(t))
        exit()
    for i in range(ind,123):
        t.append(chr(i))
        cal(i)
        t.pop()


for i in range(40):
    t=[chr(97+i)]
    cal(97+i)
0