Created
July 31, 2021 07:25
-
-
Save hanjae-jea/df0ce38b90bca518e4b7c2c468e51eec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verify(k: int, n: int, box): | |
for i in range(k): | |
s1 = set() | |
for n1 in range(n): | |
for n2 in range(n1 + 1, n): | |
s1.add(abs(box[i][n1] - box[i][n2])) | |
for j in range(i+1, k): | |
s2 = set() | |
for n1 in range(n): | |
for n2 in range(n1 + 1, n): | |
s2.add(abs(box[j][n1] - box[j][n2])) | |
if len(s1 & s2) > 0: | |
print(f"{i} 번째 상자, {j} 번째 상자, {list(s1 & s2)}") | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment