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 <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
using namespace std;
int main() {
int n;
cin >> n;
string aa[n], bb[n];
for (int i = 0; i < n; i++) {
cin >> aa[i];
}
for (int i = 0; i < n; i++) {
cin >> bb[i];
}
map <string, string> m;
for (int i = 0; i < n; i++) {
string a = aa[i], b = bb[i];
if (isdigit(a[0]) && !isdigit(b[0])) {
if (m[b] == "") {
m[b] = a;
} else if (m[b] != a) {
cout << "NE" << endl;
return 0;
}
} else if (isdigit(b[0]) && !isdigit(a[0])) {
if (m[a] == "") {
m[a] = b;
} else if (m[a] != b) {
cout << "NE" << endl;
return 0;
}
}
}
cout << "DA" << endl;
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... |