Submission #100382

#TimeUsernameProblemLanguageResultExecution timeMemory
100382cveleZamjena (COCI18_zamjena)C++14
0 / 70
7 ms1024 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...