Submission #74316969
Source Code Expand
#include<bits/stdc++.h>
//#define int long long
//#define MSOD
//#define READ_IN_FILE
#define endl '\n'
#define FAST ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
const int N=1e3+10,P=998244353,MOD=1e9+7,inf=0x3f3f3f3f;
bool cmpbig(int i,int j)
{
return i>j;
}
double mylog(int x,int y)
{
return log(x)/log(y);
}
long long qpow(long long a,long long b,long long mod=LLONG_MAX)
{
long long num=1;
while(b)
{
if(b&1)num=num*a%mod;
a=a*a%mod;
b>>=1;
}
return num;
}
int n,c[N][N];
void solve()
{
cin>>n;
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
cin>>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])
{
cout<<"Yes";
return;
}
cout<<"No";
return;
}
signed main()
{
FAST
#ifdef READ_IN_FILE
freopen(".in","r",stdin);
freopen(".out","w",stdout);
#endif
int _T_=1;
#ifdef MSOD
cin>>_T_;
#endif
while(_T_--)solve();
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Split Ticketing |
| User | Little_Cck |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 1021 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 4228 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 | 1 ms | 3800 KiB |
| 00_sample_02.txt | AC | 1 ms | 3580 KiB |
| 01_01.txt | AC | 1 ms | 3480 KiB |
| 01_02.txt | AC | 1 ms | 3820 KiB |
| 01_03.txt | AC | 1 ms | 3836 KiB |
| 02_01.txt | AC | 1 ms | 3536 KiB |
| 02_02.txt | AC | 1 ms | 3724 KiB |
| 02_03.txt | AC | 1 ms | 4056 KiB |
| 03_01.txt | AC | 1 ms | 3564 KiB |
| 03_02.txt | AC | 1 ms | 3864 KiB |
| 03_03.txt | AC | 1 ms | 3944 KiB |
| 04_01.txt | AC | 1 ms | 3480 KiB |
| 04_02.txt | AC | 1 ms | 3672 KiB |
| 04_03.txt | AC | 1 ms | 4228 KiB |
| 04_04.txt | AC | 1 ms | 4076 KiB |
| 04_05.txt | AC | 1 ms | 3716 KiB |
| 04_06.txt | AC | 1 ms | 3560 KiB |