Submission #10683058


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,M = map(int,read().split())

def solve(N,M):
    if N > M:
        return solve(M,N).T
    H = np.array([[0]], np.int8)
    for i in range(M):
        H = np.tile(H, (2,2))
        H[1<<i:,1<<i:] ^= 1
    H = np.diff(H, axis=0)
    H = np.diff(H, axis=1)
    return (H % 2)[:(1<<N) - 1]

H = solve(N,M)
size = 0
for row in H:
    word = ''.join(row.astype(str))
    print(word)
    

Submission Info

Submission Time
Task E - Odd Sum Rectangles
User maspy
Language Python3 (3.4.3)
Score 900
Code Size 546 Byte
Status
Exec Time 575 ms
Memory 21428 KB

Test Cases

Set Name Score / Max Score Test Cases
All 900 / 900 00_sample_01, 02_random_01, 02_random_02, 02_random_03, 02_random_04, 02_random_05, 02_random_06, 02_random_07, 02_random_08, 02_random_09, 02_random_10, 02_random_11, 02_random_12, 02_random_13, 02_random_14, 02_random_15, 02_random_16
sample 0 / 0 00_sample_01
Case Name Status Exec Time Memory
00_sample_01 300 ms 21428 KB
02_random_01 146 ms 12460 KB
02_random_02 147 ms 12416 KB
02_random_03 147 ms 12416 KB
02_random_04 156 ms 14696 KB
02_random_05 159 ms 14696 KB
02_random_06 575 ms 15460 KB
02_random_07 358 ms 14948 KB
02_random_08 363 ms 14948 KB
02_random_09 205 ms 14696 KB
02_random_10 263 ms 14696 KB
02_random_11 150 ms 12528 KB
02_random_12 150 ms 12416 KB
02_random_13 146 ms 12416 KB
02_random_14 153 ms 13168 KB
02_random_15 148 ms 12460 KB
02_random_16 150 ms 12416 KB