Submission #74272881


Source Code Expand

#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;
using db = long double;

int main(){
	fastio;
	int n;cin >> n;
	vector<vector<ll>> arr(n+1,vector<ll>(n+1,-1));
	for (int i=1;i<n;i++){
		for (int j=i+1;j<=n;j++){
			ll a;cin >> a;
			arr[i][j]=a;
		}
	}
	for (int i=1;i<=n;i++){
		for (int j=i+1;j<=n;j++){
			for (int k=j+1;k<=n;k++){
				if (arr[i][j]+arr[j][k]<arr[i][k]){
					cout << "Yes";return 0;
				}
			}
		}
	}cout << "No";
	return 0;
}

Submission Info

Submission Time
Task B - Split Ticketing
User Axteln
Language C++23 (GCC 15.2.0)
Score 200
Code Size 565 Byte
Status AC
Exec Time 1 ms
Memory 3776 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 3560 KiB
00_sample_02.txt AC 1 ms 3636 KiB
01_01.txt AC 1 ms 3492 KiB
01_02.txt AC 1 ms 3716 KiB
01_03.txt AC 1 ms 3776 KiB
02_01.txt AC 1 ms 3532 KiB
02_02.txt AC 1 ms 3572 KiB
02_03.txt AC 1 ms 3756 KiB
03_01.txt AC 1 ms 3492 KiB
03_02.txt AC 1 ms 3776 KiB
03_03.txt AC 1 ms 3636 KiB
04_01.txt AC 1 ms 3540 KiB
04_02.txt AC 1 ms 3588 KiB
04_03.txt AC 1 ms 3716 KiB
04_04.txt AC 1 ms 3564 KiB
04_05.txt AC 1 ms 3556 KiB
04_06.txt AC 1 ms 3628 KiB