답안 #60943

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
60943 2018-07-25T03:59:58 Z 0xrgb 마라톤 경주 (COCI14_utrka) C++17
80 / 80
185 ms 17432 KB
#include <iostream>
#include <string>
#include <unordered_set>
#include <cassert>

int main() {
	using namespace std;
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int N;
	cin >> N;
	N = N * 2 - 1;

	unordered_set<string> s;
	string x;
	for (int i = N; i--; ) {
		cin >> x;
		auto it = s.find(x);
		if (it == s.end()) s.insert(x);
		else s.erase(it);
	}

	assert(s.size() == 1);
	cout << (*s.begin()) << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 3 ms 496 KB Output is correct
4 Correct 3 ms 608 KB Output is correct
5 Correct 4 ms 712 KB Output is correct
6 Correct 65 ms 5532 KB Output is correct
7 Correct 133 ms 9180 KB Output is correct
8 Correct 150 ms 12376 KB Output is correct
9 Correct 152 ms 15152 KB Output is correct
10 Correct 185 ms 17432 KB Output is correct