https://i0.wp.com/eblogarithm.com/wp-content/uploads/2017/08/Codeforces-Round-420-Div-2-problem-A-Okabe-and-Future-Gadget-Laboratory-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #420 (Div. 2), problem: (A) Okabe and Future Gadget Laboratory Solution In C/C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a[55][55],i,j,k,l,f;
cin>>n;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
cin>>a[i][j];
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
f=0;
for(k=0;k<n;k++)
for(l=0;l<n;l++)
if(a[i][j]==a[i][k]+a[l][j]||a[i][j]==1)
f=1;
if(!f)
{
cout<<“No\n”;
return 0;
}
}
cout<<“Yes\n”;
return 0;
}

(Visited 11 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: