Submission #1215730

#TimeUsernameProblemLanguageResultExecution timeMemory
1215730Robert_juniorUtrka (COCI14_utrka)C++20
80 / 80
111 ms20424 KiB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
#define ins insert
#define pb push_back
#define F first
#define S second
const int N = 1e6 + 7, M = 5e5 + 7;
const int mod = 1e9 + 7;
void solve(){
    int n;
    cin>>n;
    string a[n + 1];
    map<string, int>mp, mp1;
    for(int i = 1; i <= n; i++){
        cin>>a[i];
        mp1[a[i]]++;
    }
    for(int i = 1; i < n; i++){
        string x;
        cin>>x;
        mp[x]++;
    }
    for(int i = 1; i <= n; i++){
        if(mp[a[i]] != mp1[a[i]]){
            cout<<a[i];
            return;
        }
    }
}
signed main(){
    ios_base :: sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t; 
    for(int i = 1; i <= t; i++){
        //cout<<"Case "<<i<<": ";
        solve();
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...