Submission #94536

# Submission time Handle Problem Language Result Execution time Memory
94536 2019-01-20T04:47:35 Z YamiDust Zamjena (COCI18_zamjena) C++14
14 / 70
9 ms 4216 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector < string > S(50010),T(50010);

map <string , string > mp;

bool comp (string A, string B){
    if (A==B)
        return true;
    if (A[0]>='0' && A[0]<='9') {
        if (B[0]>='0' && B[0]<='9') {
            return false;
        }
        else {
            if (mp[B]=="") {
                mp[B]=A;
            }
            else {
                if (mp[B]!=A) {
                    return false;
                }
            }
        }
    }
    return true;
}

int main () {
    int N;
    scanf("%d",&N);
    vector < string > S(N+1),T(N+1);
    for (int i=0;i<N;i++) {
        cin >> S[i];
    }
    for (int i=0;i<N;i++) {
        cin >> T[i];
    }
    for (int i=0;i<N;i++){
        if (!comp(min(S[i],T[i]),max(S[i],T[i]))) {
            printf("NE\n");
            return 0;
        }
    }
    printf("DA\n");
    return 0;
}

Compilation message

zamjena.cpp: In function 'int main()':
zamjena.cpp:34:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&N);
     ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 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 Correct 5 ms 3448 KB Output is correct
5 Correct 4 ms 3448 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 3448 KB Output is correct
2 Incorrect 4 ms 3452 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 3448 KB Output is correct
2 Correct 4 ms 3448 KB Output is correct
3 Correct 4 ms 3480 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 5 ms 3576 KB Output is correct
2 Correct 5 ms 3576 KB Output is correct
3 Incorrect 5 ms 3704 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 4216 KB Output isn't correct
2 Halted 0 ms 0 KB -