#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Incorrect |
5 ms |
640 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
1024 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |