답안 #75410

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
75410 2018-09-09T15:33:39 Z khalilmiri 콤보 (IOI18_combo) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include <string>
#include "combo.h"
using namespace std;
vector<int> tab;
int press(string p)
{
    
}
string guess_sequence(int N)
{   tab.push_back(0);
tab.push_back(1);
tab.push_back('X' - 'A');
tab.push_back('Y'- 'A');
    do{ string g="";
         for(int i=0;i<3;i++)
       {           
            char x= tab[i] + 'A';
            g=g+x;
            
            }
        if(press(g)==3)
        {
            return(g);
        }
        
    }while(next_permutation(tab.begin(),tab.end()));
}

Compilation message

combo.cpp: In function 'int press(std::string)':
combo.cpp:9:1: warning: no return statement in function returning non-void [-Wreturn-type]
    9 | }
      | ^
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
/usr/bin/ld: /tmp/ccrRDP4P.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccbTTBuP.o:combo.cpp:(.text.unlikely+0x0): first defined here
collect2: error: ld returned 1 exit status