# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300299 | nadidadit | Connecting Supertrees (IOI20_supertrees) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int arra[n][n],adit[n][n];
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
adit[i][j]=0;
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cin>>arra[i][j];
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i-j==1 || j-i==1 || i==j)
{
adit[i][j]=1;
}
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(j<n-1)
{
cout<<adit[i][j]<<" ";
}
}
cout<<endl;
}
}