Submission #372736

#TimeUsernameProblemLanguageResultExecution timeMemory
372736Carmel_Ab1Combo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" #include "grader.cpp" using namespace std; string guess_sequence(int n) { string ans; while(ans.size()!=n){ for(char c:"ABXY") { if(!ans.empty() && ans[0]==c)continue; int res=press(ans+string(n-ans.size(),c)); if(res>ans.size()){ ans+=string(res-ans.size(),c); break; } } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    7 |     while(ans.size()!=n){
      |           ~~~~~~~~~~^~~
combo.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |             if(res>ans.size()){
      |                ~~~^~~~~~~~~~~
/usr/bin/ld: /tmp/ccHRehhm.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/ccBVVQsp.o:combo.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccHRehhm.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccBVVQsp.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status