Submission #1006693

#TimeUsernameProblemLanguageResultExecution timeMemory
1006693devariaotaCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() string guess_sequence(int n) { string S = "ABXY"; for (char a = 0; a < 4; a++) for (char b = 0; b <4; b++) for (char c = 0; c < 4; c++) for (char d = 0; d < 4; d++) { string res; res += S[a] + S[b] + S[c] + S[d]; int x = press(res); if (x == 4) { cout << res; return; } } } // string guess_sequence(int N) { // string permu = "AAAABBBBXXXXYYYY"; // do { // cout << permu << endl; // } while (next_permutation(all(permu))); // }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:7: error: return-statement with no value, in function returning 'std::string' {aka 'std::__cxx11::basic_string<char>'} [-fpermissive]
   14 |       return;
      |       ^~~~~~
combo.cpp:7:14: warning: control reaches end of non-void function [-Wreturn-type]
    7 |   string S = "ABXY";
      |              ^~~~~~