Submission #713558

# Submission time Handle Problem Language Result Execution time Memory
713558 2023-03-22T13:27:07 Z ALTAKEXE Utrka (COCI14_utrka) C++14
0 / 80
1000 ms 4860 KB
#include<bits/stdc++.h>
using namespace std;
int main(){
    //freopen("input.txt","r",stdin);
    long long int n,t=1;
    scanf("%lld",&n);
    n=n+(n-1);
    vector<string> v;
    while(n--){
        string a;
        cin>>a;
        v.push_back(a);
    }
    for(int i=0;i<v.size();i++){
        t=1;
        while(t<v.size()){
            if(v[i]==v[i+t]) v[i]='0',v[i+t]='0';
        t++;
        }
    }
    sort(v.rbegin(),v.rend());
    cout<<v[0];
    return 0;
}

Compilation message

utrka.cpp: In function 'int main()':
utrka.cpp:14: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]
   14 |     for(int i=0;i<v.size();i++){
      |                 ~^~~~~~~~~
utrka.cpp:16:16: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         while(t<v.size()){
      |               ~^~~~~~~~~
utrka.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~
# 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 Correct 6 ms 356 KB Output is correct
4 Correct 20 ms 340 KB Output is correct
5 Correct 21 ms 420 KB Output is correct
6 Execution timed out 1094 ms 4860 KB Time limit exceeded
7 Halted 0 ms 0 KB -