Submission #713546

# Submission time Handle Problem Language Result Execution time Memory
713546 2023-03-22T13:00:20 Z ALTAKEXE Utrka (COCI14_utrka) C++14
0 / 80
1 ms 308 KB
#include<bits/stdc++.h>
using namespace std;
int main(){
   // freopen("input.txt","r",stdin);
    int n;
    cin>>n;
    n=n+(n-1);
    vector<string> v;
    vector<int> k;
    while(n--){
        string a;
        cin>>a;
        v.push_back(a);
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++){
        if(v[i]==v[i+1]) k.push_back(i),k.push_back(i+1);
    }
    for(int j=0;j<v.size();j++){
        for(int i=0;i<k.size();i++){
            if(k[j]!=j){
                cout<<v[j];
                return 0;
            }
        }
    }
    return 0;
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:16:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(int i=0;i<v.size();i++){
      |                 ~^~~~~~~~~
utrka.cpp:19:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int j=0;j<v.size();j++){
      |                 ~^~~~~~~~~
utrka.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for(int i=0;i<k.size();i++){
      |                     ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 308 KB Output isn't correct
4 Halted 0 ms 0 KB -