Submission #2100543
Source Code Expand
import numpy as np N = 100 A = np.array([np.array(list(input().split()), dtype=int) for i in range(N)]) result = [] idxMax = np.argmax(A) r = int(idxMax / N) c = int(idxMax % N) hight = A[r][c] val = hight diff = [0] view = np.array([[1, 0], [-1, 0], [0, 1], [0, -1]]) for n in range(1, N): val -= 1 if val < 0: break cand = [] view2 = np.array([[0, 0]]) for v1 in view: for v2 in view: view2 = np.append(view2, [v1 + v2], axis=0) view2 = list(map(list, set(map(tuple, view2)))) for i, j in view2: if 0 <= r + i * n < N and 0 <= c + j * n < N and not (i == 0 and j == 0): cand.append(A[r + i * n][c + j * n]) if len(cand) == 0: break diff.append(min(cand) - val) hight += min(diff) result.append([r, c, hight]) print(len(result)) for r in result: for i in range(3): print(r[i], end=" ") print()
Submission Info
Submission Time | |
---|---|
Task | A - 積雪深差 |
User | nabehide |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 910 Byte |
Status | RE |
Exec Time | 1643 ms |
Memory | 22040 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | RE | 1643 ms | 22040 KB |
00_sample_02.txt | RE | 147 ms | 12500 KB |
00_sample_03.txt | RE | 147 ms | 12500 KB |
test_01.txt | RE | 146 ms | 12404 KB |
test_02.txt | RE | 146 ms | 12404 KB |
test_03.txt | RE | 146 ms | 12500 KB |
test_04.txt | RE | 146 ms | 12404 KB |
test_05.txt | RE | 147 ms | 12404 KB |
test_06.txt | RE | 146 ms | 12500 KB |
test_07.txt | RE | 146 ms | 12404 KB |
test_08.txt | RE | 146 ms | 12404 KB |
test_09.txt | RE | 146 ms | 12404 KB |
test_10.txt | RE | 146 ms | 12404 KB |
test_11.txt | RE | 148 ms | 12404 KB |
test_12.txt | RE | 146 ms | 12404 KB |
test_13.txt | RE | 147 ms | 12404 KB |
test_14.txt | RE | 146 ms | 12404 KB |
test_15.txt | RE | 147 ms | 12404 KB |
test_16.txt | RE | 147 ms | 12500 KB |
test_17.txt | RE | 148 ms | 12404 KB |