#include <bits/stdc++.h>
using namespace std;
const int N = 50000 + 123;
int n;
string a[N], b[N];
set <string> s;
map <string, set <string>> d;
int main () {
cin >> n;
for (int i = 1;i <= n;i ++) {
cin >> a[i];
if (a[i][0] > '9') {
s.insert (a[i]);
}
}
for (int i = 1;i <= n;i ++) {
cin >> b[i];
if (b[i][0] > '9') {
s.insert (b[i]);
}
}
for (int i = 1;i <= n;i ++) {
if (a[i][0] > '9') {
d[a[i]].insert (b[i]);
}
if (b[i][0] > '9') {
d[b[i]].insert (a[i]);
}
}
for (auto it : s) {
int cnt = 0;
for (auto v : d[it]) {
if (v[0] <= '9')cnt ++;
}
if (cnt >= 2) {
cout << "NE";
exit (0);
}
}cout << "DA";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
3452 KB |
Output is correct |
2 |
Incorrect |
5 ms |
3536 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
3448 KB |
Output is correct |
2 |
Incorrect |
5 ms |
3448 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
3448 KB |
Output is correct |
2 |
Correct |
5 ms |
3448 KB |
Output is correct |
3 |
Correct |
5 ms |
3448 KB |
Output is correct |
4 |
Incorrect |
5 ms |
3448 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
3704 KB |
Output is correct |
2 |
Correct |
7 ms |
3700 KB |
Output is correct |
3 |
Incorrect |
30 ms |
4348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
33 ms |
6264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |