結果

問題 No.2037 NAND Pyramid
ユーザー hir355hir355
提出日時 2022-08-12 22:02:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 258,288 KB
最終ジャッジ日時 2023-10-24 10:05:15
合計ジャッジ時間 7,542 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,388 KB
testcase_01 AC 37 ms
53,388 KB
testcase_02 AC 35 ms
53,388 KB
testcase_03 AC 35 ms
53,388 KB
testcase_04 AC 36 ms
53,388 KB
testcase_05 AC 36 ms
53,388 KB
testcase_06 AC 36 ms
53,388 KB
testcase_07 AC 241 ms
213,136 KB
testcase_08 AC 115 ms
124,544 KB
testcase_09 AC 196 ms
172,832 KB
testcase_10 AC 99 ms
126,360 KB
testcase_11 AC 259 ms
231,404 KB
testcase_12 AC 139 ms
146,280 KB
testcase_13 AC 66 ms
83,140 KB
testcase_14 AC 162 ms
151,232 KB
testcase_15 AC 161 ms
153,340 KB
testcase_16 AC 144 ms
128,984 KB
testcase_17 AC 90 ms
105,416 KB
testcase_18 AC 89 ms
105,416 KB
testcase_19 AC 254 ms
258,120 KB
testcase_20 AC 268 ms
258,288 KB
testcase_21 AC 159 ms
122,988 KB
testcase_22 AC 152 ms
122,992 KB
testcase_23 AC 182 ms
160,920 KB
testcase_24 AC 180 ms
160,880 KB
testcase_25 AC 109 ms
116,272 KB
testcase_26 AC 125 ms
134,184 KB
testcase_27 AC 225 ms
222,988 KB
testcase_28 AC 153 ms
158,188 KB
testcase_29 AC 154 ms
165,904 KB
testcase_30 AC 227 ms
220,460 KB
testcase_31 AC 279 ms
257,912 KB
testcase_32 AC 295 ms
256,404 KB
testcase_33 AC 47 ms
62,032 KB
testcase_34 AC 53 ms
66,396 KB
testcase_35 AC 56 ms
68,492 KB
testcase_36 AC 53 ms
66,404 KB
testcase_37 AC 57 ms
68,492 KB
testcase_38 AC 53 ms
68,460 KB
testcase_39 AC 53 ms
66,412 KB
testcase_40 AC 47 ms
62,016 KB
testcase_41 AC 45 ms
62,016 KB
testcase_42 AC 50 ms
64,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
s = list(map(int, input()))
while n != k:
    while n % 3 != k % 3:
        t = []
        for i in range(n - 1):
            if s[i] & s[i + 1]:
                t.append(0)
            else:
                t.append(1)
        s = t[:]
        n -= 1
    x = (n - k) // 3
    if x > 0:
        s = s[x:-x]
        n = len(s)
print(*t, sep='')
0