結果

問題 No.2037 NAND Pyramid
ユーザー qwewe
提出日時 2025-05-14 12:54:18
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 597 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,608 KB
実行使用メモリ 61,264 KB
最終ジャッジ日時 2025-05-14 12:55:41
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 TLE * 1 -- * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    K = int(input[1])
    S = input[2]
    m = N - K
    result = []
    for i in range(K):
        window = S[i:i+m+1]
        current = list(map(int, window))
        for step in range(m):
            next_level = []
            for j in range(len(current)-1):
                a = current[j]
                b = current[j+1]
                next_level.append(1 - (a & b))
            current = next_level
        result.append(str(current[0]))
    print(''.join(result))

if __name__ == "__main__":
    main()
0