답안 #713556

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
713556 2023-03-22T13:25:10 Z ALTAKEXE 마라톤 경주 (COCI14_utrka) C++14
0 / 80
1000 ms 5816 KB
#include<bits/stdc++.h>
using namespace std;
int main(){
    //freopen("input.txt","r",stdin);
    long long int n;
    cin>>n;
    n=n+(n-1);
    vector<string> v;
    vector<int> k;
    while(n--){
        string a;
        cin>>a;
        v.push_back(a);
    }
    long long int t=1;
    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++;
        }
    }
    for(int i=0;i<v.size();i++){
        if(v[i]!="0"){
            cout<<v[i];
            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:18: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]
   18 |         while(t<v.size()){
      |               ~^~~~~~~~~
utrka.cpp:26: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]
   26 |     for(int i=0;i<v.size();i++){
      |                 ~^~~~~~~~~
# 결과 실행 시간 메모리 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 440 KB Output is correct
5 Correct 22 ms 432 KB Output is correct
6 Execution timed out 1097 ms 5816 KB Time limit exceeded
7 Halted 0 ms 0 KB -