답안 #713558

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
713558 2023-03-22T13:27:07 Z ALTAKEXE 마라톤 경주 (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);
      |     ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 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 -