Submission #87798

# Submission time Handle Problem Language Result Execution time Memory
87798 2018-12-02T15:15:37 Z asifthegreat Utrka (COCI14_utrka) C++14
80 / 80
525 ms 25744 KB
#include <bits/stdc++.h>
using namespace std;

map<string,int>mp;
set<string>st;

int main()
{
    int n;
    scanf("%d",&n);
    string s;
    for(int i = 1; i <= n;i++){
        cin >> s;
        mp[s]++;
        st.insert(s);
    }
    for(int i = 1; i < n;i++){
        cin >> s;
        mp[s]--;
    }
    for(auto x:st){
        if(mp[x]){
            printf("%s\n",x.c_str());
            return 0;
        }
    }
    return 0;
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 27 ms 376 KB Output is correct
3 Correct 3 ms 544 KB Output is correct
4 Correct 5 ms 616 KB Output is correct
5 Correct 5 ms 716 KB Output is correct
6 Correct 190 ms 9564 KB Output is correct
7 Correct 439 ms 15180 KB Output is correct
8 Correct 504 ms 20032 KB Output is correct
9 Correct 525 ms 23616 KB Output is correct
10 Correct 491 ms 25744 KB Output is correct