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 <bits/stdc++.h>
using namespace std;
int n;
int l[100010],r[100010],u[100010],d[100010];
int main()
{
cin>>n;
for (int i=0;i<n;i++)
cin>>l[i];
for (int i=0;i<n;i++)
cin>>r[i];
for (int i=0;i<n;i++)
cin>>u[i];
for (int i=0;i<n;i++)
cin>>d[i];
for (int i=0;i<n;i++)
{
if (l[i]==-1||r[i]==-1)
{if (l[i]!=r[i])
{
cout <<"NE";
return 0;
}}
else if (l[i]+r[i]>=n)
{
cout <<"NE";
return 0;
}
}
for (int i=0;i<n;i++)
{
if (u[i]==-1||d[i]==-1)
{if (u[i]!=d[i])
{
cout <<"NE";
return 0;
}}
else if (u[i]+d[i]>=n)
{
cout <<"NE";
return 0;
}
}
cout <<"DA";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |