結果

問題 No.2037 NAND Pyramid
ユーザー ニックネームニックネーム
提出日時 2022-08-12 22:13:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 307 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 19,644 KB
最終ジャッジ日時 2024-04-21 01:59:47
合計ジャッジ時間 11,031 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
17,820 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 31 ms
10,624 KB
testcase_07 AC 510 ms
11,392 KB
testcase_08 AC 42 ms
11,516 KB
testcase_09 AC 452 ms
11,392 KB
testcase_10 AC 1,054 ms
11,768 KB
testcase_11 AC 882 ms
11,392 KB
testcase_12 AC 263 ms
11,136 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 1,055 ms
11,604 KB
testcase_15 AC 280 ms
11,520 KB
testcase_16 AC 1,047 ms
11,616 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 719 ms
11,904 KB
testcase_20 AC 718 ms
11,904 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
s = input()
if (n-k)%2:
    t = ""
    for i in range(n-1):
        t += "0" if s[i:i+2] == "11" else "1"
    n -= 1
    s = t
if k == n: print(s); exit()
ans = ""
for i in range((n-k)//2, (n-k)//2+k):
    ans += "0" if s[i] == "0" or s[i-1:i+2] == "010" else "1"
print(ans)
0