제출 #1020651

#제출 시각아이디문제언어결과실행 시간메모리
1020651khome콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(long long N) { vector<string> a; a={"A", "B", "X", "Y"}; // cout << N << "\n"; string res, per = ""; while (res.size()!=N){ for (string i : a){ if (per != i && press(res+i) == (res+i).size()){ // cout << press(res+i) << ' ' << res+i << "\n"; if (per == "") per = i; res += i; } } } // cout << res << "\n"; return res; }

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

combo.cpp: In function 'std::string guess_sequence(long long int)':
combo.cpp:11:22: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   11 |     while (res.size()!=N){
      |            ~~~~~~~~~~^~~
combo.cpp:13:38: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         if (per != i && press(res+i) == (res+i).size()){
      |                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cctfEwr1.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status