結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,308 KB
testcase_01 AC 35 ms
53,308 KB
testcase_02 AC 35 ms
53,308 KB
testcase_03 AC 36 ms
53,308 KB
testcase_04 AC 35 ms
53,308 KB
testcase_05 AC 36 ms
53,308 KB
testcase_06 AC 36 ms
53,308 KB
testcase_07 AC 226 ms
213,052 KB
testcase_08 AC 118 ms
124,484 KB
testcase_09 AC 199 ms
172,744 KB
testcase_10 AC 102 ms
126,300 KB
testcase_11 AC 252 ms
231,436 KB
testcase_12 AC 135 ms
146,220 KB
testcase_13 AC 69 ms
83,068 KB
testcase_14 AC 167 ms
151,212 KB
testcase_15 AC 163 ms
153,272 KB
testcase_16 AC 144 ms
128,924 KB
testcase_17 AC 93 ms
105,356 KB
testcase_18 AC 91 ms
105,356 KB
testcase_19 AC 247 ms
257,876 KB
testcase_20 AC 269 ms
258,212 KB
testcase_21 AC 161 ms
123,012 KB
testcase_22 AC 149 ms
123,016 KB
testcase_23 AC 181 ms
160,928 KB
testcase_24 AC 181 ms
160,920 KB
testcase_25 AC 109 ms
116,276 KB
testcase_26 AC 126 ms
134,184 KB
testcase_27 AC 224 ms
223,000 KB
testcase_28 AC 148 ms
158,188 KB
testcase_29 AC 155 ms
165,908 KB
testcase_30 AC 231 ms
220,488 KB
testcase_31 AC 261 ms
258,224 KB
testcase_32 AC 287 ms
256,472 KB
testcase_33 AC 48 ms
62,096 KB
testcase_34 AC 52 ms
66,460 KB
testcase_35 AC 57 ms
68,556 KB
testcase_36 AC 53 ms
66,468 KB
testcase_37 AC 57 ms
68,556 KB
testcase_38 AC 54 ms
68,524 KB
testcase_39 AC 52 ms
66,476 KB
testcase_40 AC 46 ms
62,080 KB
testcase_41 AC 45 ms
62,080 KB
testcase_42 AC 49 ms
64,172 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