Submission #1046911

#TimeUsernameProblemLanguageResultExecution timeMemory
104691112345678Utrka (COCI14_utrka)C++17
80 / 80
93 ms12112 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod=1e9+7, nx=1e5+5; ll n, mul=31; map<ll, pair<string, ll>> mp; string s; ll solve() { ll sz=s.size(), res=0; for (int i=0; i<sz; i++) res=(res*mul)%mod, res+=s[i]-'a'+1; return res; } int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; for (int i=1; i<=n; i++) cin>>s, mp[solve()].first=s, mp[solve()].second++; for (int i=1; i<n; i++) cin>>s, mp[solve()].second--; for (auto [x, y]:mp) if (y.second!=0) cout<<y.first; }
#Verdict Execution timeMemoryGrader output
Fetching results...