# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
100382 |
2019-03-10T19:37:51 Z |
cvele |
Zamjena (COCI18_zamjena) |
C++14 |
|
7 ms |
1024 KB |
#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 |
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 |
- |
# |
Verdict |
Execution time |
Memory |
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 |
- |
# |
Verdict |
Execution time |
Memory |
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 |
- |
# |
Verdict |
Execution time |
Memory |
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 |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
1024 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |