Submission #336590

#TimeUsernameProblemLanguageResultExecution timeMemory
336590ljuba콤보 (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string press_sequence(int n) { string ans; if(press("AB")) { if(press("A")) ans += 'A'; else ans += 'B'; } else if(press("X")) { ans += 'X'; } else { ans += 'Y'; } if(n <= 1) return ans; vector<char> kar; if(ans != "A") kar.push_back('A'); if(ans != "B") kar.push_back('B'); if(ans != "X") kar.push_back('X'); if(ans != "Y"); kar.push_back('Y'); for(int i = 1; i < n-1; ++i) { string s = ans + kar[0] + ans + kar[1] + kar[0] + ans + kar[1] + kar[1] + ans + kar[1] + kar[2]; int x = press(s) - (i+1); if(x == 0) { ans += kar[2]; } else if(x == 1) { ans += kar[0]; } else { ans += kar[1]; } } if(press(ans+kar[0]) == n) { ans += kar[0]; } else if(press(ans+kar[1]) == n) { ans += kar[1]; } else { ans += kar[2]; } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string press_sequence(int)':
combo.cpp:28:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   28 |     if(ans != "Y");
      |     ^~
combo.cpp:29:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   29 |         kar.push_back('Y');
      |         ^~~
/usr/bin/ld: /tmp/ccKbSaxJ.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status