提出 #74285296
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
vector<vector<int>> map(n+1, vector<int>(n+1, 0));
bool found = false;
for (int i = 1; i <= n-1; i++) {
for (int j = i + 1; j <= n; j++) {
cin >> map[i][j];
}
}
for (int i = 1; i <= n-1; i++) {
for (int j = i+1; j <= n; j++) {
for (int k = j+1; k <= n; k++) {
if (map[i][j] + map[j][k] < map[i][k]) {
found = true;
break;
}
}
}
}
if (found) cout << "Yes\n";
else cout << "No\n";
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Split Ticketing |
| ユーザ | s1mply |
| 言語 | C++23 (GCC 15.2.0) |
| 得点 | 200 |
| コード長 | 698 Byte |
| 結果 | AC |
| 実行時間 | 2 ms |
| メモリ | 3712 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3516 KiB |
| 00_sample_02.txt | AC | 1 ms | 3580 KiB |
| 01_01.txt | AC | 1 ms | 3516 KiB |
| 01_02.txt | AC | 1 ms | 3568 KiB |
| 01_03.txt | AC | 2 ms | 3696 KiB |
| 02_01.txt | AC | 1 ms | 3616 KiB |
| 02_02.txt | AC | 1 ms | 3528 KiB |
| 02_03.txt | AC | 2 ms | 3696 KiB |
| 03_01.txt | AC | 1 ms | 3524 KiB |
| 03_02.txt | AC | 2 ms | 3684 KiB |
| 03_03.txt | AC | 2 ms | 3700 KiB |
| 04_01.txt | AC | 1 ms | 3564 KiB |
| 04_02.txt | AC | 1 ms | 3572 KiB |
| 04_03.txt | AC | 1 ms | 3712 KiB |
| 04_04.txt | AC | 2 ms | 3708 KiB |
| 04_05.txt | AC | 1 ms | 3576 KiB |
| 04_06.txt | AC | 1 ms | 3560 KiB |