#include <bits/stdc++.h>
using namespace std;
#ifndef HELLO_PEOPLE
#define cerr if(0) cout
#endif
using ll = long long;
using ld = long double;
#define reps(a, b, x, s) \
for (decay<decltype(b)>::type x = a; x < b; x += s)
#define pers(b, a, x, s) \
for (decay<decltype(b)>::type x = b; x >= a; x -= s)
#define rep(a, b, x) reps(a, b, x, 1)
#define per(b, a, x) pers(b, a, x, 1)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define X first
#define Y second
template<class C>
inline int constexpr __size(C c) { return c.size(); }
#define size __size
template<int D, class T>
struct vec : public vector<vec<D - 1, T>> {
template <class... Args>
vec(int n = 0, Args... a) :
vector<vec<D - 1, T>>(n, vec<D - 1, T>(a...)) {}
};
template<typename T>
struct vec<1, T> : public vector<T> {
vec(int n = 0, T const &val = T()) :
vector<T>(n, val) {}
};
// now start
ll const INF = 1e14;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
multiset<string> s1;
auto &&in = []() {
string s;
cin >> s;
return s;
};
rep (0, n, i) s1.emplace(in());
rep (0, n - 1, i) s1.erase(s1.find(in()));
cout << *s1.begin();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
512 KB |
Output is correct |
5 |
Correct |
5 ms |
384 KB |
Output is correct |
6 |
Correct |
70 ms |
6008 KB |
Output is correct |
7 |
Correct |
117 ms |
8696 KB |
Output is correct |
8 |
Correct |
153 ms |
10616 KB |
Output is correct |
9 |
Correct |
243 ms |
11640 KB |
Output is correct |
10 |
Correct |
173 ms |
11640 KB |
Output is correct |