Submission #74275670


Source Code Expand

#include <bits/stdc++.h>
#define ll long long
const ll N = 1e6 + 5, MOD = 1e9 + 7, inf = 2e18;
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
char di[] = {'R', 'L', 'D', 'U'};
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

void Ebraam() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
}

void solve() {
    int n;
    cin >> n;
    vector<vector<int> > v(n, vector<int>(n, 0));
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            cin >> v[i][j];
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; k < n; k++) {
                if (v[i][j] + v[j][k] < v[i][k])return cout << "Yes", void();
            }
        }
    }
    cout << "No";
}

int main() {
    Ebraam();
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
        if (t)cout << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task B - Split Ticketing
User Ebraam_Yousef
Language C++23 (GCC 15.2.0)
Score 200
Code Size 1426 Byte
Status AC
Exec Time 1 ms
Memory 3708 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 1 ms 3448 KiB
00_sample_02.txt AC 1 ms 3580 KiB
01_01.txt AC 1 ms 3580 KiB
01_02.txt AC 1 ms 3408 KiB
01_03.txt AC 1 ms 3708 KiB
02_01.txt AC 1 ms 3620 KiB
02_02.txt AC 1 ms 3676 KiB
02_03.txt AC 1 ms 3708 KiB
03_01.txt AC 1 ms 3620 KiB
03_02.txt AC 1 ms 3592 KiB
03_03.txt AC 1 ms 3536 KiB
04_01.txt AC 1 ms 3576 KiB
04_02.txt AC 1 ms 3456 KiB
04_03.txt AC 1 ms 3708 KiB
04_04.txt AC 1 ms 3660 KiB
04_05.txt AC 1 ms 3548 KiB
04_06.txt AC 1 ms 3412 KiB