Submission #85520

#TimeUsernameProblemLanguageResultExecution timeMemory
85520JustasLeCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string ans = ""; string poss = "ABXY"; for (int i = 0; i < 4; i++) { string temp = "" + poss[i]; int cnt = press(temp); if (cnt > 0) { poss.erase(poss.begin() + i); ans += temp; break; } } if(N == 1) { return ans; } bool ok = true; int prev = 1; while (ok && (int) ans.Size() < N) { ok = false; for (int i = 0; i < 3; i++) { string newAns = ans + "" + poss[i]; int cnt = press(newAns); if(cnt > prev) { ans = newAns; ok = true; prev = cnt; break; } } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:25: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'Size'; did you mean 'size'?
   23 |  while (ok && (int) ans.Size() < N) {
      |                         ^~~~
      |                         size