結果

問題 No.1643 Not Substring
ユーザー lllllll88938494lllllll88938494
提出日時 2022-08-19 00:14:54
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 630 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 284,568 KB
最終ジャッジ日時 2023-07-28 23:56:35
合計ジャッジ時間 4,224 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,828 KB
testcase_01 AC 70 ms
71,228 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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