Submission #74272298


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,char> pic;
typedef vector<int> vi;
typedef vector<ll> vll;
#define SZ(x) ((int)x.size())
ll ksm(ll a,ll b,ll p){if (p == 1)return 0;if (b == 0)return 1%p;
ll ans = 1;	a %= p;while (b > 0){if (b&1){ans = ans*a%p;}a = (a*a)
%p;b >>= 1;}return ans;}
const int mod = 1e9+7;
const int P = 998244353;
const ll inf = (1LL << 50LL);
const ll N = 5010;

int n;
int c[110][110];
int main(){
	scanf("%d",&n);
	for (int i = 1;i <= n-1;i++){
		for (int j = i+1;j <= n;j++){
			scanf("%d",&c[i][j]);
		}
	}
	for (int i = 1;i <= n;i++){
		for (int j = i+1;j <= n;j++){
			for (int k = j+1;k <= n;k++){
				if (c[i][j]+c[j][k] < c[i][k]){
					printf("Yes");
					return 0;
				}
			}
		}
	}
	printf("No");
		
    return 0;
}

Submission Info

Submission Time
Task B - Split Ticketing
User wuqize
Language C++23 (GCC 15.2.0)
Score 200
Code Size 905 Byte
Status AC
Exec Time 2 ms
Memory 3940 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 3728 KiB
00_sample_02.txt AC 1 ms 3676 KiB
01_01.txt AC 1 ms 3732 KiB
01_02.txt AC 1 ms 3708 KiB
01_03.txt AC 2 ms 3756 KiB
02_01.txt AC 1 ms 3760 KiB
02_02.txt AC 1 ms 3804 KiB
02_03.txt AC 2 ms 3940 KiB
03_01.txt AC 1 ms 3768 KiB
03_02.txt AC 2 ms 3896 KiB
03_03.txt AC 2 ms 3928 KiB
04_01.txt AC 1 ms 3768 KiB
04_02.txt AC 1 ms 3768 KiB
04_03.txt AC 2 ms 3840 KiB
04_04.txt AC 2 ms 3868 KiB
04_05.txt AC 1 ms 3676 KiB
04_06.txt AC 1 ms 3760 KiB