Submission #141154

# Submission time Handle Problem Language Result Execution time Memory
141154 2019-08-07T03:08:59 Z Breno_XD Utrka (COCI14_utrka) C++14
80 / 80
390 ms 8208 KB
#include <map>
#include <iostream>
#include <cstdio>
using namespace std;

int n;
map<string, int> mapa;

int main(){

    //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    scanf("%d", &n);

    for(int i=1; i<=n; i++){
        string s;
        cin >> s;
        mapa[s]++;
    }

    for(int i=1; i<n; i++){
        string s;
        cin >> s;
        mapa[s]--;
    }

    for(map<string,int>::iterator it = mapa.begin(); it!=mapa.end(); it++){

        if(it->second == 1){
            cout << it->first << "\n";
            break;
        }

    }

    return 0;
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:13: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 348 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 4 ms 376 KB Output is correct
6 Correct 171 ms 4320 KB Output is correct
7 Correct 273 ms 6172 KB Output is correct
8 Correct 349 ms 7496 KB Output is correct
9 Correct 390 ms 8208 KB Output is correct
10 Correct 374 ms 8200 KB Output is correct