제출 #956050

#제출 시각아이디문제언어결과실행 시간메모리
956050Faissel콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "grader.cpp" #include "combo.h" #define ll long long #define endl '\n' string guess_sequence(int n) { string y = "ABXY"; string ans = ""; for(int i=1;i<=n;i++){ bool f= false; for(int j=0;j<y.size()-1;j++){ int val = press(ans+y[j]); if(val == i){ ans += y[j]; f = true; if(i==1)y.erase(y.begin()+j); break; } } if(!f){ ans += y[y.size()-1]; if(i==1)y.erase(y.begin()+y.size()-1); } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |       for(int j=0;j<y.size()-1;j++){
      |                   ~^~~~~~~~~~~
/usr/bin/ld: /tmp/ccdLmrMV.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/ccPdLXmU.o:combo.cpp:(.text+0xc0): first defined here
/usr/bin/ld: /tmp/ccdLmrMV.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccPdLXmU.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status