結果
問題 |
No.2037 NAND Pyramid
|
ユーザー |
![]() |
提出日時 | 2025-04-24 12:30:42 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 597 bytes |
コンパイル時間 | 250 ms |
コンパイル使用メモリ | 82,172 KB |
実行使用メモリ | 53,652 KB |
最終ジャッジ日時 | 2025-04-24 12:31:47 |
合計ジャッジ時間 | 5,149 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 3 TLE * 1 -- * 35 |
ソースコード
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()