結果

問題 No.1376 Simple LPS Problem
ユーザー 👑 KazunKazun
提出日時 2021-02-05 23:03:05
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,276 KB
最終ジャッジ日時 2023-09-15 10:33:16
合計ジャッジ時間 8,505 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,460 KB
testcase_01 AC 172 ms
77,112 KB
testcase_02 AC 76 ms
71,172 KB
testcase_03 AC 75 ms
71,396 KB
testcase_04 AC 73 ms
70,968 KB
testcase_05 AC 77 ms
71,176 KB
testcase_06 AC 74 ms
71,336 KB
testcase_07 AC 72 ms
71,136 KB
testcase_08 AC 72 ms
71,152 KB
testcase_09 AC 72 ms
71,324 KB
testcase_10 AC 73 ms
71,156 KB
testcase_11 AC 74 ms
70,992 KB
testcase_12 AC 71 ms
71,332 KB
testcase_13 AC 71 ms
71,120 KB
testcase_14 AC 70 ms
71,356 KB
testcase_15 AC 73 ms
70,972 KB
testcase_16 AC 71 ms
71,332 KB
testcase_17 AC 76 ms
76,184 KB
testcase_18 AC 75 ms
76,012 KB
testcase_19 AC 72 ms
71,188 KB
testcase_20 AC 72 ms
70,968 KB
testcase_21 AC 72 ms
71,136 KB
testcase_22 AC 71 ms
71,112 KB
testcase_23 AC 83 ms
76,208 KB
testcase_24 AC 82 ms
76,080 KB
testcase_25 AC 72 ms
71,176 KB
testcase_26 AC 72 ms
71,460 KB
testcase_27 AC 73 ms
71,400 KB
testcase_28 AC 91 ms
76,948 KB
testcase_29 AC 93 ms
77,276 KB
testcase_30 AC 72 ms
71,136 KB
testcase_31 AC 74 ms
71,184 KB
testcase_32 AC 74 ms
70,992 KB
testcase_33 AC 73 ms
71,356 KB
testcase_34 AC 97 ms
77,136 KB
testcase_35 AC 97 ms
77,180 KB
testcase_36 AC 97 ms
77,124 KB
testcase_37 AC 74 ms
71,400 KB
testcase_38 AC 74 ms
71,156 KB
testcase_39 AC 74 ms
71,124 KB
testcase_40 AC 73 ms
71,124 KB
testcase_41 AC 76 ms
71,268 KB
testcase_42 AC 75 ms
72,248 KB
testcase_43 AC 74 ms
72,540 KB
testcase_44 AC 77 ms
71,344 KB
testcase_45 AC 75 ms
71,328 KB
testcase_46 AC 75 ms
72,284 KB
testcase_47 AC 77 ms
71,632 KB
testcase_48 AC 73 ms
71,908 KB
testcase_49 AC 73 ms
71,264 KB
testcase_50 AC 74 ms
71,324 KB
testcase_51 AC 75 ms
72,208 KB
testcase_52 AC 75 ms
71,544 KB
testcase_53 AC 79 ms
71,952 KB
testcase_54 AC 74 ms
71,832 KB
testcase_55 AC 73 ms
70,896 KB
testcase_56 AC 71 ms
71,144 KB
testcase_57 AC 73 ms
71,076 KB
testcase_58 AC 73 ms
71,428 KB
testcase_59 AC 73 ms
71,812 KB
testcase_60 AC 74 ms
71,076 KB
testcase_61 AC 72 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(S):
    N=len(S)
    X=set()
    for i in range(N):
        for j in range(i+1,N+1):
            T=S[i:j]
            if T==T[::-1]:
                X.add(len(T))
    return max(X)

from itertools import product
N,K=map(int,input().split())

if N<=10:
    for t in product(["0","1"],repeat=N):
        S=""
        for s in t:
            S+=s
        if f(S)==K:
            print(S)
            exit()
    print(-1)
else:
    if K<=3:
        print(-1)
        exit()

    S="1"*K+"010011"*N
    S=S[:N]
    print(S)
0