제출 #85520

#제출 시각아이디문제언어결과실행 시간메모리
85520JustasLeCombo (IOI18_combo)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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