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 Python (3.4.3)
Score 900
Code Size 546 Byte
Status AC
Exec Time 575 ms
Memory 21428 KB

Judge Result

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