結果

問題 No.1376 Simple LPS Problem
ユーザー wotsushiwotsushi
提出日時 2020-11-07 12:47:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 485 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 9,260 KB
最終ジャッジ日時 2023-09-30 01:47:04
合計ジャッジ時間 7,222 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,128 KB
testcase_01 AC 26 ms
9,100 KB
testcase_02 AC 26 ms
9,172 KB
testcase_03 AC 26 ms
9,088 KB
testcase_04 AC 26 ms
9,100 KB
testcase_05 AC 26 ms
9,100 KB
testcase_06 AC 25 ms
9,124 KB
testcase_07 AC 25 ms
9,168 KB
testcase_08 AC 25 ms
9,092 KB
testcase_09 AC 25 ms
9,188 KB
testcase_10 AC 25 ms
9,180 KB
testcase_11 AC 25 ms
9,120 KB
testcase_12 AC 25 ms
9,228 KB
testcase_13 AC 25 ms
9,044 KB
testcase_14 AC 25 ms
9,244 KB
testcase_15 AC 25 ms
9,236 KB
testcase_16 AC 25 ms
9,176 KB
testcase_17 AC 25 ms
9,216 KB
testcase_18 AC 25 ms
9,152 KB
testcase_19 AC 25 ms
9,256 KB
testcase_20 AC 26 ms
9,204 KB
testcase_21 AC 26 ms
9,160 KB
testcase_22 AC 25 ms
9,120 KB
testcase_23 AC 26 ms
9,232 KB
testcase_24 AC 25 ms
9,216 KB
testcase_25 AC 24 ms
9,148 KB
testcase_26 AC 26 ms
9,088 KB
testcase_27 AC 25 ms
9,044 KB
testcase_28 AC 25 ms
9,112 KB
testcase_29 AC 25 ms
9,116 KB
testcase_30 AC 26 ms
9,232 KB
testcase_31 AC 26 ms
9,132 KB
testcase_32 AC 25 ms
9,088 KB
testcase_33 AC 26 ms
9,240 KB
testcase_34 AC 25 ms
9,204 KB
testcase_35 AC 26 ms
9,100 KB
testcase_36 AC 25 ms
9,096 KB
testcase_37 AC 26 ms
9,132 KB
testcase_38 AC 25 ms
9,096 KB
testcase_39 AC 25 ms
9,180 KB
testcase_40 AC 24 ms
9,156 KB
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import re

lines = []
for line in sys.stdin:
    lines.append(line)
pos_int = r"[1-9]\d*"
assert len(lines) == 1
assert re.fullmatch(fr"{pos_int} {pos_int}\n", lines[0])
N, K = map(int, lines[0].split())
assert 1 <= K <= N <= 1000

if 2 * K >= N:
    S = "0" * K + "1" * (N - K)
elif N <= 8 and K == 3:
    S = "00010" + "1" * (N - 5)
elif N >= 9 and K >= 4:
    S = "1" * K
    T = "001011"
    for i in range(N - K):
        S += T[i % len(T)]
else:
    S = "-1"
print(S)
0