# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1046911 | 12345678 | Utrka (COCI14_utrka) | C++17 | 93 ms | 12112 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |