Submission #74281050


Source Code Expand

n = int(input())
lst = []

for _ in range(n-1):
    lst.append(list(map(int, input().split())))

for a in range(n):
    for b in range(a+1, n):
        for c in range(b+1, n):
            cost_ab = lst[a][b-a-1]
            cost_bc = lst[b][c-b-1]
            cost_ac = lst[a][c-a-1]
            
            if cost_ac > cost_ab + cost_bc:
                print("Yes")
                exit()

print("No")

Submission Info

Submission Time
Task B - Split Ticketing
User gett
Language Python (PyPy 3.11-v7.3.20)
Score 200
Code Size 422 Byte
Status AC
Exec Time 60 ms
Memory 91188 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_01.txt, 01_02.txt, 01_03.txt, 02_01.txt, 02_02.txt, 02_03.txt, 03_01.txt, 03_02.txt, 03_03.txt, 04_01.txt, 04_02.txt, 04_03.txt, 04_04.txt, 04_05.txt, 04_06.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 50 ms 79880 KiB
00_sample_02.txt AC 50 ms 79756 KiB
01_01.txt AC 50 ms 79716 KiB
01_02.txt AC 52 ms 86368 KiB
01_03.txt AC 55 ms 86936 KiB
02_01.txt AC 50 ms 79704 KiB
02_02.txt AC 57 ms 90280 KiB
02_03.txt AC 58 ms 91188 KiB
03_01.txt AC 50 ms 79804 KiB
03_02.txt AC 60 ms 90800 KiB
03_03.txt AC 59 ms 90960 KiB
04_01.txt AC 50 ms 79540 KiB
04_02.txt AC 51 ms 79820 KiB
04_03.txt AC 58 ms 90704 KiB
04_04.txt AC 58 ms 90936 KiB
04_05.txt AC 51 ms 79444 KiB
04_06.txt AC 51 ms 79880 KiB