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>
#include <map>
using namespace std;
int main(){
int n,m,q;
cin>>n>>m>>q;
int c[n];
pair<int,int>pa[n];
for(int i=0;i<n;i++){
cin>>c[i];
pa[i].first=i+1;
pa[i].second=c[i];
}
int h,f;
string a[q];
for(int i=0;i<q;i++){
cin>>h>>f;
if(h==pa[i].first&&f==pa[i].second) {
a[i]="DA";
}
else if (h==pa[i].second&&f==pa[i].first){
a[i]="DA";
}
else{
a[i]="NE";
}
}
for(int i=0;i<q;i++){
cout<<a[i]<<endl;
}
}
# | 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... |