Submission #165345

# Submission time Handle Problem Language Result Execution time Memory
165345 2019-11-26T12:48:16 Z Asag Zamjena (COCI18_zamjena) C++14
0 / 70
33 ms 6264 KB
#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";
}
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 6264 KB Output isn't correct
2 Halted 0 ms 0 KB -