답안 #472148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472148 2021-09-13T08:14:27 Z Mr_Ph Zamjena (COCI18_zamjena) C++14
0 / 70
20 ms 2972 KB
///made by : Mr_Ph :D
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
const double PI=acos(-1.0);
const ll mod=(ll)1e9+7;
//int a1[4] = {0, 0, 1, -1};
//int b1[4] = {1, -1, 0, 0};
///the defines :)
#define endl '\n'
#define vi vector<int>
#define vll vector<ll>
#define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ent_arr for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
///the end of the defines ;)
void solve()
{
    int n;
    cin>>n;
    vector<string>arr(n);
    vector<string>brr(n);
    ent_arr
    map<string,string>mp;
    for(int i=0;i<brr.sz;i++)
    {
        cin>>brr[i];
        mp[brr[i]]=brr[i];
    }
    for(int i=0;i<n;i++)
    {
        if(arr[i]!=mp[brr[i]])
            mp[brr[i]]=arr[i];
    }
    for(int i=0;i<n;i++)
    {
        if(arr[i]!=mp[brr[i]])
        {
            cout<<"NE"<<endl;
            return;
        }
    }
    cout<<"DA"<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    //freopen("window.in","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;//int st;
    //cin>>t;//cin>>st;
    while(t--)
        solve();
}

Compilation message

zamjena.cpp: In function 'void solve()':
zamjena.cpp:18:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 | #define ent_arr for(int i=0;i<arr.size();i++)cin>>arr[i];
      |                             ~^~~~~~~~~~~
zamjena.cpp:29:5: note: in expansion of macro 'ent_arr'
   29 |     ent_arr
      |     ^~~~~~~
zamjena.cpp:31:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(int i=0;i<brr.sz;i++)
      |                  ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 1484 KB Output is correct
2 Incorrect 20 ms 2972 KB Output isn't correct
3 Halted 0 ms 0 KB -