Submission #74315814
Source Code Expand
import sys
input = sys.stdin.readline
N = int(input())
C = [[0]*N for _ in range(N)]
for i in range(N-1):
row = list(map(int, input().split()))
for j, val in enumerate(row):
C[i][i+1+j] = val
C[i+1+j][i] = val
for k in range(N):
for i in range(N):
for j in range(N):
if C[i][j] > C[i][k] + C[k][j]:
print("No")
sys.exit()
print("Yes")
Submission Info
| Submission Time | |
|---|---|
| Task | B - Split Ticketing |
| User | akhiko |
| Language | Python (CPython 3.13.7) |
| Score | 0 |
| Code Size | 429 Byte |
| Status | WA |
| Exec Time | 123 ms |
| Memory | 9504 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||
| Status |
|
|
| 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 | WA | 10 ms | 9340 KiB |
| 00_sample_02.txt | WA | 10 ms | 9088 KiB |
| 01_01.txt | WA | 10 ms | 9112 KiB |
| 01_02.txt | WA | 11 ms | 9348 KiB |
| 01_03.txt | WA | 11 ms | 9504 KiB |
| 02_01.txt | WA | 10 ms | 9160 KiB |
| 02_02.txt | AC | 11 ms | 9324 KiB |
| 02_03.txt | AC | 12 ms | 9476 KiB |
| 03_01.txt | WA | 10 ms | 9216 KiB |
| 03_02.txt | WA | 12 ms | 9396 KiB |
| 03_03.txt | WA | 12 ms | 9476 KiB |
| 04_01.txt | WA | 10 ms | 9088 KiB |
| 04_02.txt | WA | 10 ms | 9160 KiB |
| 04_03.txt | WA | 107 ms | 9240 KiB |
| 04_04.txt | WA | 123 ms | 9312 KiB |
| 04_05.txt | WA | 10 ms | 9220 KiB |
| 04_06.txt | WA | 10 ms | 9216 KiB |