제출 #849477

#제출 시각아이디문제언어결과실행 시간메모리
849477Bach21콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define int long long const int m=4; string gue="ABXY"; string guess_sequence(int N) { int len[N]; string s=""; string tmp=""; int cnt=0; for (int i=0;i<N;i++) { for (int trie = 0; trie < gue.size(); trie++) { tmp = s; tmp += gue[trie]; cnt = press(tmp); if (cnt > s.size()) { s+=gue[trie]; if (i==0) gue.erase(gue.begin()+trie); break; } } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(long long int)':
combo.cpp:13:33: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for (int trie = 0; trie < gue.size(); trie++) {
      |                            ~~~~~^~~~~~~~~~~~
combo.cpp:17:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             if (cnt > s.size()) {
      |                 ~~~~^~~~~~~~~~
combo.cpp:8:9: warning: unused variable 'len' [-Wunused-variable]
    8 |     int len[N];
      |         ^~~
/usr/bin/ld: /tmp/ccEDjm4F.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status