結果

問題 No.2037 NAND Pyramid
ユーザー gr1msl3ygr1msl3y
提出日時 2022-08-17 22:49:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 78,080 KB
最終ジャッジ日時 2024-04-15 10:30:56
合計ジャッジ時間 5,248 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,584 KB
testcase_01 AC 40 ms
52,096 KB
testcase_02 AC 42 ms
52,608 KB
testcase_03 AC 41 ms
51,712 KB
testcase_04 AC 40 ms
52,096 KB
testcase_05 AC 42 ms
51,584 KB
testcase_06 AC 41 ms
52,096 KB
testcase_07 AC 82 ms
77,056 KB
testcase_08 AC 87 ms
77,304 KB
testcase_09 AC 82 ms
77,312 KB
testcase_10 AC 77 ms
76,928 KB
testcase_11 AC 82 ms
76,892 KB
testcase_12 AC 72 ms
75,756 KB
testcase_13 AC 72 ms
75,648 KB
testcase_14 AC 78 ms
76,244 KB
testcase_15 AC 84 ms
76,800 KB
testcase_16 AC 79 ms
76,904 KB
testcase_17 AC 91 ms
77,448 KB
testcase_18 AC 90 ms
77,040 KB
testcase_19 AC 93 ms
77,440 KB
testcase_20 AC 95 ms
78,080 KB
testcase_21 AC 93 ms
77,420 KB
testcase_22 AC 92 ms
77,496 KB
testcase_23 AC 98 ms
77,824 KB
testcase_24 AC 93 ms
78,048 KB
testcase_25 AC 89 ms
77,268 KB
testcase_26 AC 92 ms
76,936 KB
testcase_27 AC 94 ms
77,948 KB
testcase_28 AC 92 ms
77,056 KB
testcase_29 AC 93 ms
77,168 KB
testcase_30 AC 92 ms
77,808 KB
testcase_31 AC 93 ms
77,432 KB
testcase_32 AC 94 ms
77,884 KB
testcase_33 AC 48 ms
59,520 KB
testcase_34 AC 58 ms
64,384 KB
testcase_35 AC 58 ms
64,384 KB
testcase_36 AC 56 ms
62,464 KB
testcase_37 AC 56 ms
63,488 KB
testcase_38 AC 58 ms
63,616 KB
testcase_39 AC 57 ms
63,616 KB
testcase_40 AC 51 ms
60,800 KB
testcase_41 AC 59 ms
64,768 KB
testcase_42 AC 58 ms
63,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
S = input()
T = ''.join('0' if S[i] == S[i+1] == '1' else '1' for i in range(N-1))
U = ''.join('0' if T[i] == T[i+1] == '1' else '1' for i in range(N-2))
if (N-K) % 2:
    n = (N-K)//2
    print(T[n:N-1-n])
else:
    n = (N-K-2)//2
    print(U[n:N-2-n])
0