Submission #87396

# Submission time Handle Problem Language Result Execution time Memory
87396 2018-11-30T16:26:36 Z jvalsortav Utrka (COCI14_utrka) C++14
80 / 80
742 ms 25936 KB
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <cctype>
#include <ctime>
#include <set>
#include <string>
#include <map>

using namespace std;

int n, n2;
string str;
set <string> s;
map <string, int> m;

int main() {
	cin >> n;
	n2 = n;
	while(n--){
		cin >> str;
		s.insert(str);
		m[str]++;
	}
	
	/*for (set <string> :: iterator it = s.begin(); it != s.end(); it++){
		cout << *it << " " << m[*it] << endl;
	}
	cout << endl;*/
	
	for (int i = 0; i < n2 - 1; i++){
		cin >> str;
		if (m[str] > 1) m[str]--;
		else s.erase(str);
		
		/*for (set <string> :: iterator it = s.begin(); it != s.end(); it++){
		cout << *it << " " << m[*it] << endl;
		}
		cout << endl;*/
	}
	cout << *s.begin();



return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 3 ms 504 KB Output is correct
3 Correct 4 ms 740 KB Output is correct
4 Correct 8 ms 988 KB Output is correct
5 Correct 6 ms 988 KB Output is correct
6 Correct 316 ms 9776 KB Output is correct
7 Correct 467 ms 15312 KB Output is correct
8 Correct 653 ms 20256 KB Output is correct
9 Correct 742 ms 23696 KB Output is correct
10 Correct 699 ms 25936 KB Output is correct