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 main()
{
int n,m,q;
cin>>n>>m>>q;
map<int,pair<int,int>> x;
for (int i=1;i<=n;i++)
{
x[i].first=i;
}
int c;
for (int i=1;i<=n;i++)
{
cin>>c;
x[i].second=c;
}
int a,b;
while (q--)
{
cin>>a>>b;
if (x[a].first==b || x[a].second==b)
{
cout<<"DA\n";
}
else
cout<<"NE\n";
}
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... |