提出 #74269114
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define F first
#define S second
#define eb emplace_back
#define pb push_back
#define rep(X,a,b) for(ll X=a;X<b;++X)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) (ll)(a).size()
#define mem(a) memset(a,0,sizeof(a))
#define INF 9e18
#define EPS 1e-22
#define lc id<<1
#define rc (id<<1)+1
#define ln seg[id].lnd
#define rn seg[id].rnd
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pll,pll> pllll;
typedef long double ld;
typedef pair<ld,ld> pdd;
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cout << *it << " = " << a << '\n';
err(++it, args...);
}
pdd operator-(const pdd &a,const pdd &b){
return {a.F-b.F,a.S-b.S};
}
double cross(const pdd &a,const pdd &b){
return a.F*b.S-a.S*b.F;
}
/*#define N 20000000
vector<ll> lpf(N+1, 1);
vector<ll> prime;
for(ll i = 2; i <= N; i++){
if(lpf[i] == 1){
lpf[i] = i;
prime.eb(i);
}
for(ll j : prime){
if(i * j > N) break;
lpf[i * j] = j;
if(j == lpf[i]) break;
}
}*/
struct Fenwick {
int n;
vector<int> s;
int lowbit(int x) { return x & -x; }
Fenwick(int _n) {
n = _n + 1;
s.clear(), s.resize(n, 0);
}
void update(int i, int v) {
for (; i < n; i += lowbit(i))
s[i]+=v;
}
int query(int x) {
int pre = 0;
for (; x; x -= lowbit(x))
pre+=s[x];
return pre;
}
Fenwick(vector<int> a) {
n = a.size();
s.clear(), s.resize(n + 1, 0);
for (int i = 1; i <= n; i++)
update(i, a[i - 1]);
}
};//1 based
typedef struct linkNode{
int val;
struct linkNode *back=nullptr,*next=nullptr;
}LinkNode;
typedef struct ball{
ll size;
struct ball *boss=nullptr;
}Ball;
Ball *find(Ball *_ball){
//if(_ball==nullptr)return nullptr;
if(_ball->boss==_ball)return _ball;
return _ball->boss=find(_ball->boss);
}
void ballunion(Ball *u,Ball *v){
Ball *ub=find(u),*vb=find(v);
if(ub==vb)return;
if(ub->size>vb->size)vb->boss=ub,ub->size+=vb->size;
else ub->boss=vb,vb->size+=ub->size;
}
ll gcd(ll _a,ll _b){return _b?gcd(_b,_a%_b):_a;}
double dqpow(double _x, ll _y){
double _output=1;
while(_y){
if(_y&1)_output*=_x;
_x*=_x;
_y>>=1;
}
return _output;
}
ll qpow(ll _x, ll _y,ll _P){
ll _output=1;
while(_y){
if(_y&1)_output=_output*_x%_P;
_x=_x*_x%_P;
_y>>=1;
}
return _output;
}
ll qqpow(ll _x, ll _y){
ll _output=1;
while(_y){
if(_y&1)_output*=_x;
_x*=_x;
_y>>=1;
}
return _output;
}
ll v2(ll _x){
return _x&-_x;
}
/*struct Node{
ll info;
};
Node seg[800005];
void pull(ll id){seg[id].info=max(seg[lc].info,seg[rc].info);}
void modify(ll pos,ll v,ll L,ll R,ll id){
if(pos==L&&R==pos){
seg[id].info=v;
return;
}
ll M=L+R>>1;
if(pos<=M)modify(pos, v, L, M, lc);
else modify(pos, v, M + 1, R, rc);
pull(id);
}
ll query(ll l,ll r,ll L,ll R,ll id){
if(l <= L && R <= r) return seg[id].info;
int M=L+R>>1;
if(r <= M) return query(l, r, L, M, lc);
else if(l > M) return query(l, r, M + 1, R, rc);
else return max(query(l, r, L, M, lc),query(l, r, M + 1, R, rc));
}*/
ll n,a[105][105];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n;
rep(i,1,n)rep(j,i+1,n+1)cin>>a[i][j];
ll flag=0;
rep(i,1,n-1)rep(j,i+1,n)rep(k,j+1,n+1)if(a[i][j]+a[j][k]<a[i][k])flag=1;
if(flag)cout<<"Yes";
else cout<<"No";
return 0;
}
提出情報
コンパイルエラー
./Main.cpp: In function 'void err(std::istream_iterator<std::__cxx11::basic_string<char> >)':
./Main.cpp:27:35: warning: unused parameter 'it' [-Wunused-parameter]
27 | void err(istream_iterator<string> it) {}
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
200 / 200 |
| 結果 |
|
|
| セット名 |
テストケース |
| 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 |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_01.txt |
AC |
2 ms |
3612 KiB |
| 00_sample_02.txt |
AC |
3 ms |
3556 KiB |
| 01_01.txt |
AC |
2 ms |
3532 KiB |
| 01_02.txt |
AC |
2 ms |
3684 KiB |
| 01_03.txt |
AC |
5 ms |
3680 KiB |
| 02_01.txt |
AC |
2 ms |
3656 KiB |
| 02_02.txt |
AC |
2 ms |
3668 KiB |
| 02_03.txt |
AC |
2 ms |
3680 KiB |
| 03_01.txt |
AC |
3 ms |
3536 KiB |
| 03_02.txt |
AC |
2 ms |
3616 KiB |
| 03_03.txt |
AC |
3 ms |
3568 KiB |
| 04_01.txt |
AC |
2 ms |
3556 KiB |
| 04_02.txt |
AC |
2 ms |
3532 KiB |
| 04_03.txt |
AC |
5 ms |
3616 KiB |
| 04_04.txt |
AC |
3 ms |
3668 KiB |
| 04_05.txt |
AC |
3 ms |
3516 KiB |
| 04_06.txt |
AC |
5 ms |
3552 KiB |