Submission #648088

#TimeUsernameProblemLanguageResultExecution timeMemory
648088KenparCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
//OJUZ grind baby #include <bits/stdc++.h> #include <combo.h> using namespace std; #define ll long long char word[] = {'A', 'B', 'X', 'Y'}; string nextPermutation(string p, int N){ if(p.length() == N){ return ((press(p) == N)?p:""); }else{ string ans = ""; for(int i = 0; i < 4; i++){ string temp = p + word[i]; temp = nextPermutation(temp, N); if(temp.length() > ans.length()){ ans = temp; } } return ans; } } string guess_sentence(int N){ return nextPermutation("", N); } int main(){ int n; cin>>n; cout<<guess_sentence(n)<<endl; }

Compilation message (stderr)

combo.cpp: In function 'std::string nextPermutation(std::string, int)':
combo.cpp:11:16: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |  if(p.length() == N){
      |     ~~~~~~~~~~~^~~~
/usr/bin/ld: /tmp/ccBAYfDs.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc2rOxbp.o:combo.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccBAYfDs.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status