답안 #167252

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
167252 2019-12-07T04:20:16 Z mdn2002 Zamjena (COCI18_zamjena) C++14
28 / 70
9 ms 1652 KB
#include<bits/stdc++.h>
using namespace std;
int n;
vector<string>a,b;
map<string,string>m;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        a.push_back(s);
    }
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        b.push_back(s);
    }
    bool t=true;
    for(int i=0;i<n;i++)
    {
        string s=a[i],z=b[i];
        if('0'<=s[0]&&s[0]<='9')
        {
            if('0'<=z[0]&&z[0]<='9')
            {
                if(s!=z)
                {
                    t=false;
                    break;
                }
            }
            else m[z]=s;
        }
        else if('0'<=z[0]&&z[0]<='9')m[s]=z;
    }
    for(int i=0;i<n;i++)
    {
        string s=a[i],z=b[i];
        if(m[s].size()!=0&&m[z].size()!=0)
        {
            if(m[s]!=m[z])
            {
                t=false;
                break;
            }
        }
    }
    if(t==false)cout<<"NE";
    else cout<<"DA";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 416 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 504 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Incorrect 5 ms 760 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 1652 KB Output isn't correct
2 Halted 0 ms 0 KB -