답안 #778991

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
778991 2023-07-11T06:17:12 Z vjudge1 Zamjena (COCI18_zamjena) C++17
28 / 70
6 ms 1620 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define OYY 1000000005
#define mod 998244353
map <string,string> mp;

int32_t main(){
    faster
    int n;
    cin>>n;
    string dizi[n],dizi1[n];
    for(int i=0;i<n;i++)cin>>dizi[i];
    for(int i=0;i<n;i++)cin>>dizi1[i];
    bool stop=true;
    for(int i=0;i<n && stop ;i++){
        if ((dizi[i][0]>='0' && dizi[i][0]<='9') && (!(dizi1[i][0]>='0' && dizi1[i][0]<='9'))){
            mp[dizi1[i]]=dizi[i];
        }
        if((!(dizi[i][0]>='0' && dizi[i][0]<='9')) && (dizi1[i][0]>='0' && dizi1[i][0]<='9')){
            mp[dizi[i]]=dizi1[i];
        }
    }
    for(int i=0;i<n;i++){

        if(!(dizi[i][0]>='0' && dizi[i][0]<='9')){
            dizi[i]=mp[dizi[i]];
        }
        if(!(dizi1[i][0]>='0' && dizi1[i][0]<='9')){
            dizi1[i]=mp[dizi1[i]];
        }

    }
    ///////////////////////////////////////////////
    for(int i=0;i<n && stop;i++){
        if((dizi[i][0]>='0' && dizi[i][0]<='9') && (dizi1[i][0]>='0' && dizi1[i][0]<='9')){
            if(dizi[i]!=dizi1[i]){
                stop=false;
                break;
            }
        }
    }
    /*for(int i=0;i<n;i++)cout<<dizi[i]<<" ";
    cout<<endl;
    for(int i=0;i<n;i++)cout<<dizi1[i]<<" ";
    cout<<endl;*/

    if(stop)cout<<"DA"<<'\n';
    else cout<<"NE"<<'\n';
    return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 316 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Incorrect 0 ms 212 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Incorrect 2 ms 748 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -