Submission #34011468
Source Code Expand
from itertools import combinations
H,W=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(H)]
h,w=map(int,input().split())
B=[list(map(int,input().split())) for _ in range(h)]
def check(hidx,widx):
for i in range(h):
for j in range(w):
if A[hidx[i]][widx[j]]!=B[i][j]:
return False
return True
for hidx in combinations(range(H),h):
for widx in combinations(range(W),w):
if check(hidx,widx):
print("Yes")
exit()
print("No")
Submission Info
| Submission Time | |
|---|---|
| Task | C - Matrix Reducing |
| User | kyopro_friends |
| Language | PyPy3 (7.3.0) |
| Score | 300 |
| Code Size | 490 Byte |
| Status | AC |
| Exec Time | 88 ms |
| Memory | 74104 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 82 ms | 61984 KiB |
| 001.txt | AC | 49 ms | 61828 KiB |
| 002.txt | AC | 52 ms | 62188 KiB |
| 003.txt | AC | 49 ms | 62280 KiB |
| 004.txt | AC | 50 ms | 61948 KiB |
| 005.txt | AC | 47 ms | 62188 KiB |
| 006.txt | AC | 49 ms | 62220 KiB |
| 007.txt | AC | 54 ms | 62100 KiB |
| 008.txt | AC | 50 ms | 62228 KiB |
| 009.txt | AC | 49 ms | 62208 KiB |
| 010.txt | AC | 65 ms | 73296 KiB |
| 011.txt | AC | 74 ms | 73436 KiB |
| 012.txt | AC | 88 ms | 73892 KiB |
| 013.txt | AC | 85 ms | 73616 KiB |
| 014.txt | AC | 49 ms | 61984 KiB |
| 015.txt | AC | 50 ms | 61988 KiB |
| 016.txt | AC | 49 ms | 62132 KiB |
| 017.txt | AC | 53 ms | 62088 KiB |
| 018.txt | AC | 55 ms | 65984 KiB |
| 019.txt | AC | 57 ms | 67748 KiB |
| 020.txt | AC | 71 ms | 74104 KiB |
| 021.txt | AC | 67 ms | 73444 KiB |
| 022.txt | AC | 72 ms | 73864 KiB |
| 023.txt | AC | 72 ms | 73860 KiB |
| 024.txt | AC | 75 ms | 73940 KiB |
| 025.txt | AC | 71 ms | 74016 KiB |
| 026.txt | AC | 49 ms | 62324 KiB |
| 027.txt | AC | 53 ms | 62288 KiB |
| 028.txt | AC | 49 ms | 62580 KiB |
| 029.txt | AC | 49 ms | 62732 KiB |
| example0.txt | AC | 49 ms | 62168 KiB |
| example1.txt | AC | 48 ms | 61920 KiB |