Submission #55301512


Source Code Expand

x1, y1, z1, x2, y2, z2 = map(int, input().split())
i1, j1, k1, i2, j2, k2 = map(int, input().split())

def intersect(a, b, c, d):
    # [a, b] and [c, d]
    a, b = sorted([a, b])
    c, d = sorted([c, d])
    return not(
        d <= a or
        b <= c
    )

print(
    'Yes'
    if intersect(x1, x2, i1, i2) and intersect(y1, y2, j1, j2) and intersect(z1, z2, k1, k2)
    else 'No'
)

Submission Info

Submission Time
Task B - Intersection of Cuboids
User Shisuko
Language Python (PyPy 3.10-v7.3.12)
Score 250
Code Size 403 Byte
Status AC
Exec Time 62 ms
Memory 76856 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 22
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand.txt AC 60 ms 76664 KiB
random_01.txt AC 61 ms 76524 KiB
random_02.txt AC 61 ms 76432 KiB
random_03.txt AC 60 ms 76608 KiB
random_04.txt AC 60 ms 76728 KiB
random_05.txt AC 61 ms 76532 KiB
random_06.txt AC 61 ms 76508 KiB
random_07.txt AC 61 ms 76500 KiB
random_08.txt AC 60 ms 76832 KiB
random_09.txt AC 62 ms 76644 KiB
random_10.txt AC 60 ms 76412 KiB
random_11.txt AC 60 ms 76852 KiB
random_12.txt AC 60 ms 76812 KiB
random_13.txt AC 60 ms 76376 KiB
random_14.txt AC 61 ms 76660 KiB
random_15.txt AC 60 ms 76856 KiB
random_16.txt AC 60 ms 76404 KiB
random_17.txt AC 59 ms 76528 KiB
random_18.txt AC 60 ms 76724 KiB
sample_01.txt AC 60 ms 76796 KiB
sample_02.txt AC 61 ms 76304 KiB
sample_03.txt AC 61 ms 76720 KiB