Submission #74272845
Source Code Expand
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll=long long;
using ull= unsigned long long;
const int inf=INT_MIN/2;
const ll mod=998244353;
void b() {
int n;
cin >>n;
vector<vector<ll>> cc(n+1,vector<ll>(n+1));
for(int i=1;i<=n;i++) {
for(int j=i+1;j<=n;j++) {
cin >>cc[i][j];
}
}
for(int a=1;a<=n;a++) {
for(int b=a+1;b<=n;b++) {
for(int c=b+1;c<=n;c++) {
if(cc[a][b]+cc[b][c]<cc[a][c]) {
cout <<"Yes"<<endl;
return ;
}
}
}
}
cout <<"No"<<endl;
}
void a()
{
int n;
cin >>n;
for(int i=n;i>=2;i--) {
cout <<i<<",";
}
cout <<1<<endl;
}
int main()
{
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
// int n;
// cin >>n;
// for(int i=0;i<n;i++)
b();
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Split Ticketing |
| User | Li_x |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 949 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3660 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 | 3496 KiB |
| 00_sample_02.txt | AC | 1 ms | 3400 KiB |
| 01_01.txt | AC | 1 ms | 3532 KiB |
| 01_02.txt | AC | 1 ms | 3528 KiB |
| 01_03.txt | AC | 1 ms | 3660 KiB |
| 02_01.txt | AC | 1 ms | 3544 KiB |
| 02_02.txt | AC | 1 ms | 3640 KiB |
| 02_03.txt | AC | 1 ms | 3648 KiB |
| 03_01.txt | AC | 1 ms | 3656 KiB |
| 03_02.txt | AC | 1 ms | 3580 KiB |
| 03_03.txt | AC | 1 ms | 3660 KiB |
| 04_01.txt | AC | 1 ms | 3520 KiB |
| 04_02.txt | AC | 1 ms | 3600 KiB |
| 04_03.txt | AC | 1 ms | 3648 KiB |
| 04_04.txt | AC | 1 ms | 3660 KiB |
| 04_05.txt | AC | 1 ms | 3600 KiB |
| 04_06.txt | AC | 1 ms | 3412 KiB |