| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 28 | 4 | 4 | 50.000% |
You are given an array $A$ containing $N$ non-negative integers. You have to construct a binary grid of size $N \times M$ such that:
Find any such binary grid or tell that it's impossible to construct.
The first line contains two integers $N$ and $M$ ($1 \leq N, M \leq 1000$). The next line contains $N$ integers containing $A_i$ ($0 \leq A_i \leq M$).
Output $N$ lines, each containing $M$ characters of either 0 or 1 representing the binary grid you constructed. If multiple construction exists, you may output any of them. If such a grid does not exist, output $-1$.
6 7 4 3 2 2 3 4
1010101 0101010 1010000 0000101 0101010 1010101
2 2 2 2
-1