제출 #139610

#제출 시각아이디문제언어결과실행 시간메모리
139610Bazarkuly2003콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h" #include<string> #include<bits/stdc++.h> #include <cstdio> #include <cstdlib> #include <algorithm> using namespace std; string guess_sequence(int N){ string s,q,t; int m; if(press("A")==1){s="A";q="BXY";}else if(press("B")==1){s="B";q="AXY";}else if(press("X")==1){s="X";q="ABY";}else{s="Y";q="ABX";} while(s.size()<N){ t=s+q[0]+q[0]+s+q[0]+q[1]+s+q[0]+q[2]+s+q[1]; m=press(t); if(m==s.size()+0)s+=q[2];else if(m==s.size()+1)s+=q[1];else if(m==s.size()+2)s+=q[0];} return s; } int press(string p){ } //int main(){ // int N; cin>>N; // guess_sequence(N); //}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:15: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   15 | while(s.size()<N){
      |       ~~~~~~~~^~
combo.cpp:19:5: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 | if(m==s.size()+0)s+=q[2];else
      |    ~^~~~~~~~~~~~
combo.cpp:20:5: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 | if(m==s.size()+1)s+=q[1];else
      |    ~^~~~~~~~~~~~
combo.cpp:21:5: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 | if(m==s.size()+2)s+=q[0];}
      |    ~^~~~~~~~~~~~
combo.cpp: In function 'int press(std::string)':
combo.cpp:25:1: warning: no return statement in function returning non-void [-Wreturn-type]
   25 | }
      | ^
/usr/bin/ld: /tmp/cco1bXpN.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/ccy9ZmcK.o:combo.cpp:(.text.unlikely+0x0): first defined here
collect2: error: ld returned 1 exit status