# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94995 | karlopuh | Zamjena (COCI18_zamjena) | C++14 | 6 ms | 1012 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 <bits/stdc++.h>
using namespace std;
vector<string> polje;
int n;
string ul;
map <string,string> mapa;
int main(){
cin>>n;
for(int i=0;i<n;i++){
ul;
cin>>ul;
polje.push_back(ul);
}
for(int i=0;i<n;i++){
cin>>ul;
if(ul==polje[i])continue;
else if(ul[0] >= '0' && ul[0]<='9'){
if(polje[i][0] >='0' && polje[i][0]<='9'){
cout<<"NE";
return 0;
}else{
mapa[polje[i]]=ul;
}
}else if(polje[i][0]>='0' && polje[i][0]<='9'){
if(mapa[ul].empty())mapa[ul]=polje[i];
else if(mapa[ul]!=polje[i]){
cout<<"NE";
return 0;
}
}
}
cout<<"DA";
}
Compilation message (stderr)
# | 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... |