Submission #365445

# Submission time Handle Problem Language Result Execution time Memory
365445 2021-02-11T17:06:05 Z alrad Utrka (COCI14_utrka) C++17
80 / 80
98 ms 10000 KB
#include <bits/stdc++.h>

using namespace std;

using ld = long double;
using ull = unsigned long long;

/*
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("-O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

template <class T> inline T gcd(T a , T b) { return !a ? b : gcd(b % a , a); }
template <class T> inline T lcm(T a , T b) {return (a * b) / gcd(a , b) ; }

mt19937 rnd(time(0));

#define all(x) x.begin(), x.end()
#define debug(x) { cerr << #x << " = " << x << endl; }ы

void solve() {
  int n;
  cin >> n;
  unordered_map<string, bool> cnt;
  for (int i = 1; i <= n; i++) {
    string name;
    cin >> name;
    cnt[name] ^= 1;
  }
  for (int i = 1; i < n; i++) {
    string name;
    cin >> name;
    cnt[name] ^= 1;
  }
  for (auto it : cnt) {
    if (it.second == 1) {
      cout << it.first << '\n';
      return;
    }
  }
  return;
}

signed main() {
  ios_base :: sync_with_stdio(0);
  cin.tie(0) , cout.tie(0);
  int t = 1;
  while (t-- > 0) {
    solve();
  }
  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 492 KB Output is correct
5 Correct 1 ms 492 KB Output is correct
6 Correct 32 ms 5240 KB Output is correct
7 Correct 62 ms 7824 KB Output is correct
8 Correct 75 ms 9360 KB Output is correct
9 Correct 85 ms 10000 KB Output is correct
10 Correct 98 ms 10000 KB Output is correct