Submission #76012486
Source Code Expand
Copy
#include <stdio.h>int N;int C[1024][1024];int main(void) {int a, b, c;if (scanf("%d", &N) != 1) return 1;for (a = 0; a < N; a++) {for (b = a + 1; b < N; b++) {if (scanf("%d", &C[a][b]) != 1) return 1;}}for (a = 0; a < N; a++) {for (b = a + 1; b < N; b++) {for (c = b + 1; c < N; c++) {if (C[a][c] > C[a][b] + C[b][c]) {puts("Yes");return 0;}}}}puts("No");return 0;}
#include <stdio.h>
int N;
int C[1024][1024];
int main(void) {
int a, b, c;
if (scanf("%d", &N) != 1) return 1;
for (a = 0; a < N; a++) {
for (b = a + 1; b < N; b++) {
if (scanf("%d", &C[a][b]) != 1) return 1;
}
}
for (a = 0; a < N; a++) {
for (b = a + 1; b < N; b++) {
for (c = b + 1; c < N; c++) {
if (C[a][c] > C[a][b] + C[b][c]) {
puts("Yes");
return 0;
}
}
}
}
puts("No");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Split Ticketing |
| User | mikecat |
| Language | C23 (GCC 14.2.0) |
| Score | 200 |
| Code Size | 460 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2032 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 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 | AC | 0 ms | 1616 KiB |
| 00_sample_02.txt | AC | 1 ms | 1656 KiB |
| 01_01.txt | AC | 0 ms | 1696 KiB |
| 01_02.txt | AC | 1 ms | 1964 KiB |
| 01_03.txt | AC | 1 ms | 2024 KiB |
| 02_01.txt | AC | 0 ms | 1648 KiB |
| 02_02.txt | AC | 1 ms | 1952 KiB |
| 02_03.txt | AC | 1 ms | 2008 KiB |
| 03_01.txt | AC | 0 ms | 1640 KiB |
| 03_02.txt | AC | 1 ms | 2028 KiB |
| 03_03.txt | AC | 1 ms | 1992 KiB |
| 04_01.txt | AC | 0 ms | 1696 KiB |
| 04_02.txt | AC | 0 ms | 1648 KiB |
| 04_03.txt | AC | 1 ms | 1972 KiB |
| 04_04.txt | AC | 1 ms | 2032 KiB |
| 04_05.txt | AC | 0 ms | 1616 KiB |
| 04_06.txt | AC | 0 ms | 1644 KiB |