結果

問題 No.1376 Simple LPS Problem
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-02-05 22:18:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 967 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 76,652 KB
最終ジャッジ日時 2023-09-15 08:36:34
合計ジャッジ時間 9,403 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,756 KB
testcase_01 AC 72 ms
70,656 KB
testcase_02 AC 71 ms
70,732 KB
testcase_03 AC 74 ms
70,820 KB
testcase_04 AC 72 ms
70,580 KB
testcase_05 AC 73 ms
70,544 KB
testcase_06 AC 73 ms
70,784 KB
testcase_07 AC 72 ms
70,864 KB
testcase_08 AC 72 ms
70,672 KB
testcase_09 AC 74 ms
70,684 KB
testcase_10 AC 73 ms
70,728 KB
testcase_11 AC 74 ms
70,732 KB
testcase_12 AC 73 ms
70,756 KB
testcase_13 AC 75 ms
70,872 KB
testcase_14 AC 73 ms
70,656 KB
testcase_15 AC 74 ms
70,592 KB
testcase_16 AC 72 ms
70,676 KB
testcase_17 AC 73 ms
70,884 KB
testcase_18 AC 73 ms
70,540 KB
testcase_19 AC 71 ms
70,740 KB
testcase_20 AC 73 ms
70,904 KB
testcase_21 AC 72 ms
70,568 KB
testcase_22 AC 72 ms
70,740 KB
testcase_23 AC 72 ms
70,748 KB
testcase_24 AC 74 ms
70,732 KB
testcase_25 WA -
testcase_26 AC 74 ms
70,760 KB
testcase_27 AC 73 ms
70,644 KB
testcase_28 AC 73 ms
70,576 KB
testcase_29 AC 73 ms
70,888 KB
testcase_30 WA -
testcase_31 AC 71 ms
70,908 KB
testcase_32 AC 72 ms
70,736 KB
testcase_33 AC 74 ms
70,864 KB
testcase_34 AC 71 ms
70,692 KB
testcase_35 AC 73 ms
70,760 KB
testcase_36 AC 72 ms
70,760 KB
testcase_37 WA -
testcase_38 AC 72 ms
70,792 KB
testcase_39 AC 72 ms
70,868 KB
testcase_40 AC 71 ms
70,752 KB
testcase_41 AC 71 ms
70,756 KB
testcase_42 WA -
testcase_43 AC 74 ms
70,436 KB
testcase_44 AC 75 ms
71,676 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 85 ms
76,572 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 81 ms
76,652 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 75 ms
71,620 KB
testcase_56 AC 74 ms
71,184 KB
testcase_57 AC 73 ms
70,944 KB
testcase_58 AC 73 ms
70,968 KB
testcase_59 AC 70 ms
70,640 KB
testcase_60 AC 73 ms
70,640 KB
testcase_61 AC 73 ms
70,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

001101

K = 1の場合
S = 2以下じゃないと無理

dpで解く?
dpi = 現状回文になる可能性のある最長のi
偶数長と奇数長がある
両方に気を配る

K = 5の時 6にも注意する必要がある

長さ3と4を同時に潰せる?
0110 → 無理


4と5は?
0XX11X0X0

長さ5と6は?


"""

import sys
from sys import stdin

N,K = map(int,stdin.readline().split())

if K == 1:
    if N == 1:
        print ("0")
    elif N == 2:
        print ("10")
    else:
        print (-1)
    sys.exit()
elif N == K:
    print ("0"*K)
    sys.exit()

ans = [None] * N
for i in range(K):
    ans[i] = 0
ans[K] = 1

for i in range(K+1,N):

    a1 = ans[i-K] ^ 1
    a2 = ans[i-(K+1)] ^ 1

    if a1 != a2:
        print (-1)
        sys.exit()

    ans[i] = a1

print ("".join(map(str,ans)))

"""
if K == 1:
    if N == 1:
        print ("0")
    elif N == 2:
        print ("10")
    else:
        print (-1)

elif K == 2:
"""
    
0